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

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:

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:

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.
84 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.
Actually, you can do that in two different ways – with the Central Management Server’s list of servers, or with the free SSMS Tools Pack:
https://www.brentozar.com/archive/2008/08/sql-server-2008s-new-central-management-server/ – the CMS lets you set tab colors by server, and the CMS list is shared with all your users (as long as they’re using Windows auth)
http://www.ssmstoolspack.com/
Another option for colors is when you are logging in to the server, hit the “Options >>” button on the bottom right, go to “Connection Properties” tab and check “Use custom color”. Select a color. Now when you connect, the status bar (the one you just moved to the top of the editor 🙂 ) will be that color.
This setting is associated to the server you are connecting to, so it’ll remember the color next time you log in, and if you have different tabs open connected to different servers, the status bar will be the correct color on each of your tabs.
OMG…This is a great help.
I actually blogged all about how to do that using the tools/methods Brent described http://sqlchicken.com/2012/06/m3-connecting-to-wrong-environments/
Thank you. I’ve always hated the way tabs worked and this looks much better.
Amazing. Maybe you should rebrand yourself as a SQL decorator?
Extreme SQL Makeover!
best damn tip evah!!
Awesome!
Awesome tip, thanks!
Seems not to be available for sql server management studeio for sql server 2005 but still a nice tip.
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.
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!
… And SSMS won’t connect to earlier versions of Integration Services. So that sucks.
Thanks, great tip, I’ve been always bothered by the tabs!!
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
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.
Thanks for the tip.bernt
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
Thanks for the tip. I’ve always had a problem finding the tab I needed. I didn’t think to look for a solution.
This is money. Feelin’ kinda stupid now for not digging deep enough to find this. Thanks man!
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!
Jeffrey – you can use the Templates feature in SSMS. Tim’s blogged about that before:
http://www.mssqltips.com/tip.asp?tip=1465
The drawback is that you can’t save the templates on a network share, but Denali’s upcoming Snippets feature fixes that too.
Thanks. I’ll check it out. Typically I save my files to a thumb drive and not a network drive.
Maybe I am missing something since you obviously think not being able to save to a network drive is a short coming?
Could you elaborate?
Yeah, when you’ve got multiple people in a shop (developers and DBAs) it’s much easier to have a centralized set of scripts that everyone can update seamlessly.
Duh! Yeah, that’s right, I forgot. I don’t share. Muuuwwaaahahahah! Kidding.
Actually, the DBA group does, but not with the Devs. LOL.
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
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
Cool tip Brent! I thought I had been through every knob and dial in SSMS, but I have never seen/used those options.
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.
Gil – that’s a great idea. Have you entered that at Connect?
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…
HA! You overestimate my abilities. 😀 The best thing to do is just vote for that Connect request.
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.
Mark – hahaha, nice work!
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!)
David – thanks, but actually you don’t have to restart SSMS. Your changes take effect with each new opened tab.
Doh! Well that’s two things I’ve learned then. Thanks, Brent.
You can also just change the connection (re-connect) for an existing tab and the label well change.
You are my hero. Seriously great tip.
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”
Yes, and if you look at Books Online, you will see that it came out even earlier. 😉
Your version is however, easier to read than
http://msdn.microsoft.com/en-us/library/cc280602.aspx
and has probably been read by more people 🙂
Really nice tip.
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?
You can use an awesome (and free) plug-in like SSMS Tools Pack (http://ssmstoolspack.com) to do this behavior and thensome. Toolspack even color codes windows using regex based on server name if you’d like. Compatible with 2005+.
This has been a helpful tip. Do you have an update for SSMS 2012?
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).
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.
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.
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.
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 😉
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
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
Thanks for the tip. Very useful. I wish I had googled for this much earlier!
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
Stephen – hmm, interesting. So what action would you like us to take?
Seriously love this. Thank you so much!
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.
+1
+1
Thanks for the nice tip.
How can I change the default master db to user db for every new tab??
Rahul – set your default database for your login. I like using TempDB for mine. This is set in each SQL Server’s security, of course, not SSMS.
Ahhhh so simple it was but why tempdb??
Thanks
Rahul
So that if I accidentally create a table, it won’t hurt user or system databases.
OK.Thanks for the help.
And this website is so colourful, fun to read.
you are a saint
Great collection of tips; just what I was looking for.
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.
Jacob Golden – did you by any chance figure out how to get it back? it is so frustrating to keep going through all my open tabs!
I have not. I would be eternally grateful if anyone figures it out!
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.
Thanks…this is a great help ..especially working with multiple databases.
I wish they would let you just increase the width of the tab…
Thanks so much, I didn’t even realise how much this was bothering me
+1
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.
Make sure you’re in the “Tab Text” section, and not the “Status Bar” section. I may or may not have learned this firsthand 🙂
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…
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.
great tip thanks!
Thank you – very helpful 🙂
Holy shit THANK YOU THANK YOU THANK YOU.
This has annoyed the living hell out of me for far too long.
I wish we could just name the tab without having to save the file (which changes the default location for saving scripts).