Sql-server – Easy way to alias the default SQL Server instance to a named instance

aliassql server

I have SQL Server Express installed on my machine as the default instance. "server=.;database=…."
I'm now working with a new client where their config files are all checked into the repository. They use a named instance of SQL Server . "server=(local)\SQL2012;database=…."

Is it possible to set up an alias so that I don't have to overwrite anything? What I tried to do using the SQL Server Configuration Tool didn't seem to work, but perhaps I did something wrong.

Best Answer

To my knowledge there is no easy way to create a single centralized alias for a SQL server instance.

You can create aliases in the SQL client, but these have to be created on every client machine, so that's not much help. I'm also not sure if your alias can even be formatted as a named instance in that scenario. Actually, you can make an alias appear as a named instance.

In any case you're much better off updating the configs.

Edit

Based on your comment, yes I misunderstood.

In that case a SQL alias is the way to go. You can use SQL Server Configuration Manager if it's installed, but if not you can use the SQL Server Client Network Utility (cliconfig.exe).

If it's not working, one thing to check is the platform. There's a separate version for 32 bit and 64 bit if you're on a 64 bit system:

32bit:

C:\Windows\System32\cliconfig.exe

64bit:

C:\Windows\SysWOW64\cliconfig.exe

Reference

http://www.mssqltips.com/sqlservertip/1620/how-to-setup-and-use-a-sql-server-alias/