SQL Server Management Studio Tips
Introduction
SQL Server Management Studio (or SSMS) has a lot of depth to it that most of us are probably not even aware of. Typically we get into a habit of doing things on the basis of what we know. Also, I believe that as a DBA my primary concern is the databases and making sure my scripts are correct, and I’m sure I’m not alone here.
Lately I’ve tried to push myself in getting to grips with the IDE and making better use of the built in functionality. In a seriously lose tie in with Friday 13th, here’s 13 tips for using SQL Studio Management Studio. Some of them are very basic, and some of them are quite obscure.
1. Pressing Ctrl + R when you have the results window open in SSMS will auto-hide it.
To bring it back press Ctrl + R again.
2. If you accidentally hit CTRL + SHIFT + R then this may be a good thing: This will clear the cache of the Intellisense.
You can do this through the UI by going to Edit > Intellisense > Refresh Local Cache.
5. If you want to manually prompt for Intellisense then press ALT+RIGHT ARROW or CTRL+SPACE.
6. Intellisense will not work in SQLCMD mode. Check that it is enabled under Query > If you cannot see Query as a menu option click on a Query window
The sqlcmd utility is a command-line utility for ad hoc, interactive execution of Transact-SQL statements and scripts and for automating Transact-SQL scripting tasks. Though it is cmd line it can be run through the UI. If that sounds crazy then sure maybe, but it’s a lot easier than running large scripts through the UI than it is the cmd line.
7. You can enable running all new query windows in SQLCMD by going to Tools > Options > Query Execution and selecting “by default, open new queries in SQLCMD mode”.
If you want to uncomment it, then press CTRL K, CTRL U.
12. to enable or disable the line numbers in SSMS, click Tools > Options, expand the Text Editor option, expand All Languages and select General
13. If you need to go to a particular line number press CTRL + G to open the Go To Line window; enter the line number and click OK: