Learning to organize SQL Server Management Studio for different environments
Welcome to Aleson ITC’s blog. In today’s post we will talk about how to define custom color codes for connections in SQL Server.
We must be careful when executing any query, for this we can see to which instance we are connected through the bar of our SQL Server Management Studio.
To know what environment we are working in, we will determine a series of colors as we will see below.
This will help us to know in which environment we are working, that is, imagine that we have several environments to work in, Production, Pre-production and Development, since it would be convenient to know through a series of colors in which environment we are, in order to avoid errors when run code in the wrong environment.
In this post, I tell you what is the best way to organize Prod, Preprod and Dev servers.
How will we do?
1 – First we must connect to Management Studio and access View > Registered Servers.
We can create multiple Local Server Groups and within them organize more groups and subgroups. 2 – Upon entering Database Engine we will have Local Server Groups and there we will create the new server groups: DEV, PREPROD, PROD.
Once created, we should have something like this.
3 – To assign the instances to the groups we must enter New Server Registration:
4 – Let’s go to Connection Properties > Use Custom Color to set a color to the server, which will vary depending on the environment:
The color will appear in the SSMS status bar when selecting New Query.
One of the things to keep in mind is that these colors are only local in the SSMS and it is recommended not to have the same colors for different environments, this way we will avoid mistakes.
The configuration of the server groups will only be seen by our Windows user, but we can export it to a file to add it to other servers.
5 – To export it we must follow the following steps:
To finish, we will add the name with which we want this file to be exported.
It is convenient to uncheck the indicated option so that users and passwords are not included in the exported file.
To import, we will do the same by selecting the file we want to move.
And so far today’s post, we hope it will help you when working with SSMS.
If you liked it, don’t miss our TOP Posts about SQL Server.
Query Store y Automatic Tuning en SQL Server 2017
Free monitoring using InfluxDB, Telegraf and Grafana
If you want us to help your company with our SQL Server solutions, contact us.