Redgate recently released SQL Prompt 6.5. There are some nice features in this version, but my favorite is by far Tab Coloring! It is no longer an experimental feature, it has become a proper feature. I did a quick demo of Redgate SQL Prompt including Tab Coloring in my SQLBits session to show how you can save time and work more efficiently.
SQL Server Management Studio (SSMS) Coloring
With the standard SSMS options, you can set custom colors per connection or per group connection that will be used in the Status Bar in query tabs:
This is a very useful feature in SSMS that makes it easy to see which connection the current query tab is using. However, if you are a tab hoarder like me and always have many unnamed tabs open, you probably don’t enjoy clicking through all the tabs until you find the right one.
Redgate SQL Prompt 6.5 Tab Coloring
Tab Coloring saves me a lot of time because I can quickly and easily see which servers or databases are being used by looking at the query tab color. The tab colors are specified in environments, and the default environments from Redgate are Production, Staging, Testing, Development and Local:
You can add environments, remove environments by right-clicking on them, rename environements by double-clicking on the name, and select new environment colors by using the color picker. I only use Production, Test, Development and Local, but you can create as many as you want and name them anything, like User Acceptance Testing (UAT), Playground or YOU TOUCH DBA SMASH 😅
You can specify tab colors per server or database in SQL Prompt → Options → Tabs → Color:
Or by right-clicking on server groups, servers, tabs or databases:
Tab Color (Group)
If you set a tab color for a server group, all servers in that group will get the same tab color. I first thought that this worked the same way as the group connection status bar color. I thought that group connection tabs that query multiple servers at the same time would get a separate color like the pink color in the SSMS example earlier in this post. It currently does not work like that, it is only a shortcut to color all servers in a group. (I hope they can add or change that in a future release to work like SSMS group connections.)
Tab Color (Server)
You can set tab colors for individual servers. If you have already set a tab color for a server group, you can overwrite an individual server with another tab color. Keep in mind that you will overwrite individual server tab colors if you change the group tab color, so make sure you do it in the right order.
Tab Color (Database)
You can set tab colors for individual databases. These will not be affected by changes to the server tab colors.
Combined SSMS Connection Coloring and Redgate SQL Prompt Tab Coloring
(Read the note at the bottom of this post for important changes to SQL Prompt 6.6!) If you use the same colors for the SSMS Connection Coloring and the Redgate SQL Prompt Tab Coloring, you make it really easy to work with multiple tabs. If you only have one tab open at the time you will still see all the other different colored tabs, and if you keep multiple tabs open you don’t have to spend any time finding the right tab, you just look at the color. Tab colors even work with floating tabs 🥳
Updated in June 2015: I am very happy to see that this blog post inspired Redgate to improve Tab Coloring! In SQL Prompt 6.6 the status bar automatically gets the same color as the tab so you no longer have to manually set each connection color. Thank you, Redgate! 🤓
About the Author
Cathrine Wilhelmsen is a Microsoft Data Platform MVP, BimlHero Certified Expert, international speaker, author, blogger, and chronic volunteer. She loves data and coding, as well as teaching and sharing knowledge - oh, and sci-fi, chocolate, coffee, and cats 🤓