casinos

SQL Server: SSMS Tips II January 9th, 2013

Vinod Kumar

Yesterday I gave a tip over Pinal’s blog about SQL Server Management Studio and command line parameters. We did write about few more tips previously on this blog with some interesting tips. So feel free to have a look at them too. In this blog let me take few more interesting tips that I have been using with SSMS and found it interesting to share here.

1. Startup View

This is one of my favorite tip working with SSMS. Whenever SSMS starts, we can set a default view which can be interesting and combination of Query window, Object Explorer and Activity Monitor. This can be got from toolbar Tools > Options dialog box.

Options Startup

The default is “Object Explorer” and we can change this setting to change.

2. Quick Query Shortcut

In SQL Server 2000 days I remember using Query Analyzer and the most loved feature were the Query shortcuts we can use from query window. Over years have seen people forget this ever existed. Old, yet a tip I felt is worth sharing again.

Options Query Shortcut

3. WordWrap and Line numbers

This is a convenience option in my opinion. Under Text Editor > All Languages > General category there are two nice options.

1. Word wrap – With script files going in pages and most importantly long it is difficult to see in a single window without scrolling to the right. The word wrap is similar to how it happens in Notepad. The “Show visual glyphs for word wrap” is an nice option to enable. This shows a visual indicator end of the line when it wraps.

2. Line numbers – shows line numbers in your script file.

Options Word Wrap Line Numbers

4. Tab Text

We daily see some content on our tab on top of SSMS query window is not readable most of the times. I generally love to change this to filename and database name alone. This makes the tab now readable and easy to know where we are connected. Play with various values to your hearts desire.

Options Tab

5. Status bar

This is a great option for people who do presentations and demo with SQL Server Management Studio. A lot of times I need to show attendees the elapsed time, SPID, connection details. These are available in the status bar and even with ZoomIt it is difficult for people sitting in the last row to see these values. I love moving the status bar to the top with these options.

Options Status Bar

Also available in this screen is what gets displayed on your status bar. Feel free to play around with it and customize it to your requirement.

6. Decrease default # of rows selected

When we right click at a table we get “Select 1000 rows” option. This is also a configurable value and can be done under the “SQL Server Object Explorer” > Commands section as shown below.

Options Object Explorer Command

7. Batch Separator

This tip must be credited to my good friend Balmukund Lakhani (today is his B’day, follow him on twitter). It is a misunderstanding that GO is a keyword and the ONLY batch separator. Actually, a batch separator can be anything like “MySeparator” word can be used in our scripts if needbe. Interesting, isnt it?

Options Batch Separator

Hope you found these tips useful and I am sure you have your own favorites with SSMS too. So feel free to share them here. I will be more than happy to include in next blog. Thanks again for reading this far.

Tags: , , , , , , ,

This entry was posted on Wednesday, January 9th, 2013 at 08:30 and is filed under Technology. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.


9 Responses to “SQL Server: SSMS Tips II”

  1. Anup nayak says:

    I also like the feature copy header in query results, I was just talking about this with my collegue today as well and I stumbled upon this blog (co- incidence ) :)

  2. Tristan says:

    I have problems with tab text on SSMS 2012 (ver 11.0.3000.0). I have only file name set to true, and rest to false. But I still have server and database names in tab text. What can help ?

  3. PRASAD YANGAMUNI says:

    This is excellent sir, Please keep post like these useful articles.
    these shortcuts defnately useful for every one in their real life.

    Thanks,
    Prasad

  4. Rahul Singi says:

    Nice post sir.. last point about Batch Separator is really interesting..
    Thanks to share it. :)

  5. Kamlesh says:

    Very useful tips.

    Regarding Tip # 2 (Shortcut keys), one has to be bit careful if using ZoomIt utility, which also maps the CTRL+1 :) The ZoomIt shortcut always takes priority. Reconfiguring ZoomIt shortcut may avoid the problem.

Leave a Reply