Fixing SQL Server Management Studio’s Tab Text

85 Comments

I hate the way SSMS tabs look by default.  Check this out:

SSMS Tab Defaults
SSMS Tab Defaults

That’s nearly useless.  The tabs are wide, but they still don’t show useful information.  Even worse, I’ve got more tabs than I can fit in the window, so the rest hang out in a meaningless dropdown.

To fix it, click Tools, Options,and go into Text Editor, Editor Tab and Status Bar.  Check out the Tab Text options:

Tools, Options
Tools, Options

You can uncheck the database name, login name, and server name because those are shown in the status bar anyway.  Then, if you wanna get fancy, change the status bar location to Top – it’s right above the Tab Text options.  Voila:

SSMS Tabs Fixed
SSMS Tabs Fixed

When I’m working, I save my queries in c:\temp with a short descriptive name.  If I’m performance tuning, I’ll save them as Before.sql and After.sql, or maybe Index1.sql and Index2.sql.  Presto, I can easily switch tabs without playing the guessing game.

Previous Post
How to Design Multi-Client Databases
Next Post
Scaling SQL Server: Growing Out

85 Comments. Leave new

  • Hi Brent

    What would be great is a way to write a macro which would detect when the currently active database or server is on a predefined list – and if it is, change the background color of the query window. That’d be great as a warning that you are on a production database for example.

    Reply
  • Thank you. I’ve always hated the way tabs worked and this looks much better.

    Reply
  • Amazing. Maybe you should rebrand yourself as a SQL decorator?

    Reply
  • Paul Hunter
    June 7, 2011 8:55 am

    best damn tip evah!!

    Reply
  • Awesome!

    Reply
  • Shawn Johnson
    June 7, 2011 9:49 am

    Awesome tip, thanks!

    Reply
  • Seems not to be available for sql server management studeio for sql server 2005 but still a nice tip.

    Reply
    • Ramon – yeah, you should be on the latest version of SSMS at all times even if you’re connecting to SQL Server 2005. SSMS 2008 R2 has a lot of nice improvements like this.

      Reply
      • Except that the SMS 2008 activity monitor doesn’t work against SQL 2000 servers (plus, I don’t think its as useful as the SQL 2005 activity monitor). If someone made a “classic activity monitor” plugin for SMS 2008, I’d be all over it!

        Reply
  • Thanks, great tip, I’ve been always bothered by the tabs!!

    Reply
  • You put your taskbar at the top too!!! How weird!

    I did not know that you could remove the database name from the tab, or that other stuff too. Now I do.
    Thanks

    Reply
    • Task bar on the top very handy. All controls in the same place, don’t need to move move though whole screen to manage windows.

      Reply
  • Thanks for the tip.bernt

    Reply
  • Thanks Brent – didn’t know I had a problem until you came up with this solution.

    I like the staus bar at the top too, very neat.
    Seth

    Reply
  • Thanks for the tip. I’ve always had a problem finding the tab I needed. I didn’t think to look for a solution.

    Reply
  • This is money. Feelin’ kinda stupid now for not digging deep enough to find this. Thanks man!

    Reply
  • Never dawned on me that you could tweak the UI this way, although it did annoy me that the text in the tabs is useless.

    Now if I can find a better way to manage my script library. I would like to create several “Queries” folders to categorize my scripts, but SSMS doesn’t allow that (at least not that I have found). 🙂

    Thanks for the tip!

    Reply
  • Thanks for the tip

    I’m surprised I never came across this tip before
    but now it’ll be set on every SSMS I came across

    Another good tip is to change the ALT+H keyboard shortcut to ALT+G for [Change Connection] in Query window
    http://narfle.com/blog/2006/07/ssms-keyboard-shortcut-for-change.asp

    Also, I use the SSMS Tools Pack to color-code Query window

    Reply
    • Great tip, Brent…

      But I REALLY want to thank Jerry. It’s been driving me nuts that I didn’t have a shortcut to Change the Connection.

      Thanks a million!

      –Brad

      Reply
  • DamonRipper
    June 9, 2011 9:44 am

    Cool tip Brent! I thought I had been through every knob and dial in SSMS, but I have never seen/used those options.

    Reply
  • Good suggestions.

    But, I’m not sure I’ll get into the habit of saving all the scripts into files.

    I’d much rather have the option of dynamically entering the tab text and/or highlighting part of the script (the key statement or part of a comment) and in the context menu (right-click) having a “Label Tab” option (or something like that) to change to tab text to that string.

    Reply
    • Gil – that’s a great idea. Have you entered that at Connect?

      Reply
      • Thanks, Brent.

        I haven’t, but with your encouragement I went over there and found this entry:

        http://bit.ly/kT41qy

        Seems like changing the tab labeling would requiring overriding the default visual studio behavior, and they don’t seem to want to (as of a month ago). Somebody else suggested more flexible tab labeling in the comments there.

        I doubt I could get them to reconsider, but perhaps you could…

        Reply
  • Bingo 🙂 I’ve finally got the jump on you!
    http://tenbulls.co.uk/2010/07/28/make-your-tabs-more-readable-in-ssms/ …but probably not the reach hehe. I would say great minds and all that malarky, but I’ve still got work to do to get there.

    Reply
  • Thanks for a great tip, Brent. It’s probably worth mentioning for the uninitiated that you have to restart Studio before Options changes take effect. (They should add an option to change that!)

    Reply
  • Dayton brown
    June 15, 2011 10:41 pm

    You are my hero. Seriously great tip.

    Reply
  • Patrick Flynn
    June 16, 2011 9:03 am

    This is a great Tip but if you look at
    http://jmkehayias.blogspot.com/2008/07/ssms-options-in-sql-2008.html

    you will see that Jonathan Kahayias actually blogged about this back in July 2008

    Another example of “great minds think alike”

    Reply
  • Really nice tip.

    Reply
  • Really nice tip! Sadly, I’m stuck with SMSS 2005 for the moment. Anyone knows if it’s be possible to do this via registry?

    Another thing. I actually came here looking for a way to change the way new tabs are created in SMSS: They appear at the left, pushing all existing tabs to the right, which I find immensely annoying. I think they should appear to the right, just like any browser. Is this possible?

    Reply
  • Martin Lundblad
    June 18, 2012 1:05 pm

    This has been a helpful tip. Do you have an update for SSMS 2012?

    Reply
  • Vladimir Smida
    July 14, 2012 5:00 am

    In ssms2012 unchecking the server name results in the ssms crash. (Each time when query is opened and closed without any save/execute action in between).

    Reply
  • Sadly, I can’t get rid of the leading server name when designing views in SSMS 2008 R2, despite unticking this option. Go Microsoft. Oh well, at least I can now see more info on the right hand side – so now it’s only half useless.

    I still think SQL 2000 had the best UI – that just worked. Good luck trying to find deadlocks in current versions.

    Reply
  • Brent,
    Very practical and useful tip. Also your bolg post gets lots of good responses and I learn from them as well. Thanks everybody for sharing your ideas.

    Reply
  • This is nice tip, i didn’t look this option till now. Actually this helped in different way in my case though. I just displayed only file name and server name on tab, that way i could see server name always.

    Thank you.

    Reply
  • so I stumbled into a related shortcut today… I’ve been using the “Windows…” command in my toolbar for quite a while, but it still doesn’t quite mimic the window list that the old Query Manager had. I’m not sure if it’s much better, but when I added the “File List” command to my toolbar, A) it is displayed with the name “Show EzMDI File List”.. and B) it shows a hotkey shortcut of CTRL + ALT + Down Arrow.

    So did everyone else already know about the CTRL+ALT+Down thing? The fact that the list always shows up in the upper-right is a bit annoying, but it’s easier to read than the tabs! Just press that, then the down arrow a few times to select one, then enter. bam! 13 years later and we’re almost back to year-2000 usability. Now if we can only get a useful version of the Activity Monitor 😉

    Reply
  • Hi Brent,

    Thanks for this tip.

    Just want to throw an issue to see whether you have any ideas.
    Is there a way to have a convenient hot key combination for comment/un comment.

    I was used to,
    CTRL+SHIFT+C – Comment out code.
    CTRL+SHIFT+R – Remove comments (UNCOMMENT)
    combination in SQL Server 2000.

    The current combination of
    CTRL+K, CTRL+C /CTRL+K, CTRL+U need two key presses and inconvenient.

    Thanks,

    Sena

    Reply
    • Kendra Little
      June 4, 2013 1:41 pm

      Hey Sena,

      I actually like the current shortcuts for this! I find it easy ever since I learned a mneumonic device for it from Merrill Aldrich (http://sqlblog.com/blogs/merrill_aldrich/)

      Control Kansas + City

      And then the “U” the other way is almost like “undo”. For some reason this really made it easy for me. It’s definitely an american version but I bet there’s a different city name to localize it for other parts of the world.

      Just a simple idea. 🙂

      Kendra

      Reply
  • Thanks for the tip. Very useful. I wish I had googled for this much earlier!

    Reply
  • Stephen Brinkley
    July 11, 2013 1:53 pm

    I would really like the tab name to be the first x number of characters of the first line of the query. I normallyy put a short comment / description there and I don’t want to save all my queries

    Reply
  • Seriously love this. Thank you so much!

    Reply
  • Great tip !!!
    Is there a way to also apply these settings to the Query Designer windows?

    For example, when you right-click on a table name, and pick “Edit Top 200 Rows”.
    The window that comes up (which I believe it’s referred to as the “Query Designer” window), does not see to pick up these settings.

    Thank you very much.

    Reply
  • Thanks for the nice tip.
    How can I change the default master db to user db for every new tab??

    Reply
  • you are a saint

    Reply
  • Steve Mansfield
    September 2, 2015 4:12 am

    Great collection of tips; just what I was looking for.

    Reply
  • This thread is old, but have you noticed that in SSMS 2017 they have removed the “executing” text from the tab? Now I have to click back through each tab to see if it’s still running or if it finished! LOL Silly Microsoft.

    Reply
  • subash ranabhat
    February 21, 2018 10:16 am

    I tried this on ssms v17.3. but everytime I execute a table or stored proc it gives me the filename as only sqlquery1.sql / sqlquery2.sql and not the file name. My filename has schemaName.ActualFileName format.

    Reply
  • Chris Catignani
    July 3, 2018 10:25 am

    Thanks…this is a great help ..especially working with multiple databases.
    I wish they would let you just increase the width of the tab…

    Reply
  • Thanks so much, I didn’t even realise how much this was bothering me

    Reply
  • Bryan Fritchie
    January 10, 2019 9:38 am

    +1

    Reply
  • Curtis J Swanson
    January 15, 2019 2:44 pm

    Anyone else select “False” for include server, login, and/or database name and they still show on the tab after restart? I am wondering if it has something to do with the DB Forge (SQL Complete) add on that I am using, because mine will not go away.

    Reply
    • Make sure you’re in the “Tab Text” section, and not the “Status Bar” section. I may or may not have learned this firsthand 🙂

      Reply
  • I submitted this to Microsoft on https://feedback.azure.com:
    Request title:
    SSMS add a pane with a vertical list of open queries
    Description:
    In SSMS add a pane with a vertical list of open queries similar to the Object Explorer pane that can be docked/undocked that you can see the entire file name and quickly navigate or choose from the entire list of tabs of open query files to choose from.
    So, instead of horizontal tabs where the file name and other details that are partially hidden or don’t appear if many files are open, have an option to show a vertical list of open files.
    Add ability to pin so that the pinned ones go to the top of the vertical list.
    It should look like the list of Files in the Solution Explorer but only open files.
    There is at least one third party company selling a plug-in but who has money for that…

    Reply
    • I know that on the very right edge of the horizontal list of tabs, there is a drop down arrow that shows the list of tabs vertically but I’d like it to be able to dock like Object Explorer, Registered Servers, etc.

      Reply
  • Michael Murphy
    September 9, 2020 7:12 am

    great tip thanks!

    Reply
    • Have loved redgate sql prompt for years, with it it is easy to collercode tabs and make them persistant when closing SSMS.
      Have made my work much easier.

      Reply
  • Thank you – very helpful 🙂

    Reply
  • Holy shit THANK YOU THANK YOU THANK YOU.

    This has annoyed the living hell out of me for far too long.

    Reply
  • I wish we could just name the tab without having to save the file (which changes the default location for saving scripts).

    Reply

Leave a Reply

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

Fill out this field
Fill out this field
Please enter a valid email address.