Create SQL Server aliases using registry editor

Another quick one today: how do I create an alias using the registry editor? If you want to want to ask me why would you do such a thing, it means you’re reading the wrong blogJ.

To cut it short, here are the entries in the registry:

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSSQLServer\Client\ConnectTo] – this is for x64 machines who happen to need a 32-bit alias.
[HKEY_LOCAL_MACHINE\SOFTWARE\ Microsoft\MSSQLServer\Client\ConnectTo] – this is for either x86 machines, or for x64 machines that need a regular alias.

Ok, as for how I actually use it:

Fire up Notepad, make your edits, then save it as <whatevername>.reg. Double click the file and confirm that you want the entries in your registry. You now have a script ready to be deployed across multiple servers.

I hope this helps.

Best regards,
io

Comments

5 responses to “Create SQL Server aliases using registry editor”

  1. manognya Avatar
    manognya

    Hi,

    i have only HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\MSSQLSERVER\CLIENT\ path in my machine. ConnectTo folder is not present. How and what do i do to get that?

    Thanks,
    Manognya

    1. visualtalks Avatar
      visualtalks

      What version of Windows are you running?

  2. Seb Avatar
    Seb

    Hi, Do you have an example of what goes into the txt file?

    1. Calin OPREA Avatar

      sorry, nope. it varies on what you are trying to achieve.

  3. Seb Avatar
    Seb

    Ok, thanks I am trying to create the .reg file you mention above to add several aliases to the registry. What would an entry look like on the file?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.