Intresting setting in SQL Server Mananagement Studio.
1. To include line numbers in the Query Window:
Click Tools -> Options. Expand TextEditor->All Languages->General from left menu. Then select Line Numbers check box available under Display section.
2. Changing Colour of the Query’s displayed in Query Window.
Click Tools -> Options. Expand Environment->Fonts and Colors from left menu. Then select Display Items for which you wish to change colours and change them beside in drop down.
Some more cool stuff useful in SSMS:
1. You can select the object and press ALT+F1 to display the meta information about that object stored in the database.
2. Press CTRL+J for the manual list a set of objects or members after typing “Select * from ”
3. To parse all the scripts without executing them in the current query window, simply press CTRL+F5
4. To execute all the scripts in the current query window simply press F5 or you can select some lines of code to be executed then press F5
5. To minimize the typing effort, you can use the auto complete feature of IntelliSense. Simply press ALT+RIGHT ARROW or CTRL+SPACE and it will complete your word by the best and first matching member list.
6. Press CTRL+L to display the estimated query execution plan without actually running the whole query.
7. For more detailed information and review the query execution plan with the query execution results, press CTRL+M to include the actual execution plan. You can even press SHIFT+ALT+S to include the client statistics with the query results.
8. When you are writing code you may not bother with using upper or lower case to make your code easier to read. To fix this later, you can select the specific text and hit CTRL+SHIFT+U to make it upper case or use CTRL+SHIFT+L to make it lower case
9. If you know the line number you want to go to you can use CTRL+G to open the Go To Line dialog box and type the line number and press OK (or hit ENTER) to go to that particular line number.
Fixing SQL Server Mananagement Studio’s Query window header:
Instead of displaying a long name as the Tab name/header of Query Window, we can disable it to display only the Query name where possible. This can be achieved by unchecking the database name, login name, and server name in Tools-> Options->Text Editor-> Editor Tab and Status Bar -> in Tab Text options.