Sql-server – SQL Default Instance Name

databasesql serversql-server-2008

Can the default instance name be something other than (local) or (machinename)? For example, if my server is called Apple, and I install SQL Server 2008 and choose to create a default instance and name it Orange, will this work? Will I then be able to use a connection string that is "Database=Orange" from another server?

The end goal: I have a lot of DBs on a server Apple, and want them to all be moved to a new server Orange – is there a way of doing this without breaking all the connection strings that currently reference Apple?

I'm guessing the answer to all of this is no and that makes sense, but I'm hoping I'm wrong.

Best Answer

There's no way I know of to do this. The default instance is always the name of the computer that is running SQL Server.

However, you can create an alias for the server on the client machine. You can create a registry key on the client like this:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo]
"APPLE"="DBMSSOCN,ORANGE"

This will point any calls to Apple to the Orange server.