January 22, 2025 at 1:22 pm
At work we have quite a few databases that I'm frequently browsing. This is quickly becoming a real mess when I need to switch between different SSMS'es (I need to start them with different credentials) and different databases. My questions is, do you guys have any hints to make working with lots of databases/tables within SSMS to make it easier? At the moment it's very easy to do something wrong (unless you've got lots of monitors with one SSMS on each screen).
I really want something that make it obvious that "now I am working in the test-environment" and such stuff. I've found some statusbar can change it's colour but I don't think it's enough.
Thanks alot in advance.
January 22, 2025 at 2:31 pm
You could preface every script w/
SELECT @@SERVERNAME, DB_NAME()
to force you to verify the environment before running anything.
If there a few server/databases you most use, you could create SSMS shortcuts w/ different icons & aliases for each. Obviously not practical for hundreds or even dozens.
January 23, 2025 at 9:01 pm
With registered servers, you can set the color for that server on the second tab of the connection dialog by checking the "Custom Color" box. I got that from this Stack Overflow question https://stackoverflow.com/questions/53837781/ssms-color-tab-based-on-connection-string-environment
The AI in Google said to use Redgate SQL Prompt. You might consider that.
"To set a tab color in SQL Server Management Studio (SSMS) based on the database you're connected to, you need to use a third-party tool like "SQL Prompt" from Redgate, which allows you to assign different tab colors to specific databases or server environments, essentially letting you visually identify which database you're currently working with within a tab"
January 31, 2025 at 2:57 pm
You can set the connection in each query window. Right-click, Connection, Change Connection.
And, in Registered Servers, you can set the connection parameters at the server level.
That way, you only need to have 1 SSMS open.
And, I've long used the colour option in the Registered Servers panel as a visual cue to help me NOT accidentally run stuff in Prod.
February 4, 2025 at 3:30 pm
Yes use Registered Servers (View menu, Registered Servers) and collect them into Registered Server Groups like folders for files.
You can save passwords with each server registration so that it just takes a double click to open the server and, as said, they can each have a colour that shows in the main window bottom bar - I have red for production, green for development etc.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply