Shortcut: The magical F1 key – help on syntax and metadata

I used to always recommend that people install Books Online (BOL) on their systems. It's ironic that it was called "Online", given we're really talking about "Offline" nowadays, but back when we first were talking about it, we were comparing it to a physical book, not to a live reference on the Internet.

Nowadays though, I find that the version online is so far superior to the one that you can install locally, that I think it's better to just use the online version. I particularly like the way that the online books are now cross-version ie: each page covers all supported versions, instead of having a separate page for each version.

Given there is a lot of information online, what's the quickest way then to find the page that you're after?

For T-SQL commands, I find the best option is to type the command name followed by tsql into the search bar. For example, here's a search for the SET command:

Invariably, the command that you're after will be either the first or second entry.

But there's an even quicker way when you're editing in SQL Server Management Studio (SSMS). In this script that I'm editing:

If I double-click EXECUTE to highlight it, then hit F1, I'm taken directly to the correct page.

That's awesome but the F1 key can do more. If I was looking at or editing this script from WideWorldImporters:

and I'm wondering about the People table, I can highlight the full table name [Application].People, then hit Alt-F1.I'm then returned all sorts of information about the table:

What SSMS is doing is running the sp_help command for that object. In another post, we'll talk about how you could change that if needed, or change what happens with other function keys.

Leave a Reply

Your email address will not be published. Required fields are marked *