Differentiate Connections With Colored Status Bars

Introduction

How many times have you worked with SSMS (SQL Server Management Studio) while having multiple connections to different Servers? My answer would be - almost all the time, as I have to connect to local database, staging database, UAT database, and sometimes the PROD database or backup server and sometimes depending upon the kind of application, it may grow to 5-6 connections.

If you have faced such situations, then you might have experienced a little visual confusion and repeatedly cross-checked that you are executing the queries in the intended query window. Well, since SQL Server 2008, SSMS is equipped with a great feature that can help in this matter and with this small tip, we’ll see how to use this.

How to use

The following visual references will guide you through the procedure.

  1. While connecting to a server, click on Options button.



    It will unhide the detailed option panel.

  2. Go to the “Connection Properties” tab.
  3. Now, use the checkbox “Use Custom Color”.
  4. Click on the “Select” button which will pop up the color pallet,
  5. Choose a color of your choice.



  6. Press “Connect”.
  7. Open a query window to see the changes to the status bar.

That’s it. Use a different color for different connections, such as GREEN for TEST server, YELLOW for UAT server, and RED for PROD server.

Well, the story doesn’t end here. You’ll notice that once you close your SSMS and reopen it later, these changes aren't available any more and you have to repeat the process every time you create a connection. So, how to overcome this?

Have you ever used the “Registered Server” option in SSMS? That’s the solution to retain your changes even after SSMS restart. This is a very nice feature to manage your server/connection properties. As this is not in the scope of this article, we’ll discuss on what is relevant to this article. For further study, please refer to this link,

  1. Right click on the server/connection.
  2. Click on “Register…”.



  3. Go to “Connection Properties” tab. A similar window with the same properties (as we have seen in the second image) should be visible.



  4. Do the changes (if required) and click “Save”.

The beauty of the Register Server is that you don’t need to provide credentials and other server information again and again. But be careful...it may lead to security issues.

Conclusion

We have learned how to use color coding status bar for distingushing different connections while working on multiple connections/servers at the same time in SSMS.

Please leave your feedbacks on this.

Thanks for reading!