How to make an Alias for a server in SSMS (MSSQL Tools18)
Asked Answered
C

1

5

I am wondering about something. I work with a lof of SQL servers, to which I need to connect several times a day. Unfortunately there are quite a lot of them and I constantly need to check the IPs and select them by IPs. Each server belongs to a different customer, none are mine and none are local.

what I'm looking for is the ability to give them names/aliases in my SSMS application, so that when I go to connect Object explorer and get the server login screen, I don't have under "server name" a list of IP addresses, but names/aliases, that I create for my purposes only. Just as a display option, so that others' ability to connect to the servers or use them remains completely unaffected. So that instead of having a bunch of 192.168........., I could see for example: "Cust1_Prod, Cust2_Prod, Cust1_Test, Cust2_Test" aliases as I please.

Any advise would be appreciated.

Collate answered 16/3, 2020 at 13:5 Comment(3)
Have you looked at SQL aliases? learn.microsoft.com/en-us/sql/database-engine/configure-windows/…. This however would also allow clients to connect.Plumbic
What do you mean clients to connect?Collate
I believe clients will be able to use the alias as well.Plumbic
K
8

You should be able to leverage the Registered Server functionality for this.

In the toolbar, View -> Registered Servers. Pin the window that opens up.

You can create folders for more organization if you like.

Right click on a folder name and click New Server Registration. In the dialog box that opens, you can give each server whatever name you prefer. In this case, I put "My Custom Name for This Server" in the box.

enter image description here

From this list, you can right click the server name and click on Object Explorer to open the connection. In your OE window, your custom name shows up, followed by the actual name of the box.

enter image description here

These names get saved to your local config files. You can export them when you get a new machine, or if you want to share with your team, but it's strictly a local SSMS rename.

Also, once you have some servers registered, you can right click on a folder and select Object Explorer and it will open connections to all of the servers in the folder. I use that trick to cluster my Dev, UAT, and Prod boxes together, but if there are groups of servers you frequently use together, this is a quick way to get to them all with one click.

Krasnodar answered 16/3, 2020 at 13:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.