htt

Software & Programme

SQL Tricks

von
SQL

When working with SSMS it can sometimes be unclear which server you are querying. This can cause problems especially when working on test, dev and production systems as most developers do. I always like to identify my servers clearly with desktop colours and BGInfo for the RDP connections, but what about when using SSMS. How can you clearly identify the connections here?

What I do is use alias and colour coding so it looks like this: 1

2

Here’s how to do it. First set up the required aliases for your servers.

>Open up SQL Server Configuration Manager. Programs>Microsoft SQL Server 2012> Configuration Tools> SQL Server Configuration Manager

>Expand the relevant SQL Native Client (in my case 32 bit). Right click Aliases and fill in the box that opens, putting the name you want to use as Alias Name and the IP of the server, like so.

3

I also copy the Alias name at this point.

>Open up SSMS if it’s not already open and select Connect to server. Paste in the alias you copied in the step above and select/fill in your credentials. When you login the connection is now identified by its alias.4

>You can repeat the steps for your other servers.5

Now for the colour bar. Log out of your connections, and then bring up the connection dialog for each one.  Select the Options button.6

Then the Connection Properties Tab and at the bottom you can check ‘Use custom color’ and click the Select button to choose your colour for this connection.

Do this for each connection and that’s it! Now when you run a query you will see which server it was run against.

7



Lösungen, die eine fundierte Entscheidungsfindung sicherstellen?

Informationen für Ihr Unternehmen, die qualitätsgesichert, entscheidungsrelevant sind und anspruchsvolle Geschäftsanalysen bieten? Gerne unterstützen wir Sie hierbei und stehen Ihnen für eine individuelle Fragen zur Seite. Tel.: +49 (0) 70 31 714-6215 oder per Kontaktformular


Richard Raistrick

Über den Autor 

BA-Universität Sheffield. 12 Jahre Erfahrung als Enterprise Software Technical Consultant/Ingenieur bei einem der weltweit größten Softwareunternehmen. Seit Anfang 2014 bei der Insight Dimension GmbH als Consultant / Entwickler tätig.

SQL Tricks Reviewed by on .

When working with SSMS it can sometimes be unclear which server you are querying. This can cause problems especially when working on test, dev and production systems as most developers do. I always like to identify my servers clearly with desktop colours and BGInfo for the RDP connections, but what about when using SSMS. How

Hinterlasse einen Kommentar

Your email address will not be published. Required fields are marked ( required )