views:

545

answers:

2

Say I have a Server named "MyServerABC", on which I have Sql Server 2005 installed with a Default Instance. Thus I can always connect to my sql server just by specifying "MyServerABC".

Now, I change my server's name to "MyServerDEF". Will I now be able to connect to the sql server by just specifying "MyServerDEF"?

Are there any holes in my thinking? Is it really that simple, or are there additional steps involved, or potential problem areas?

A: 

If you use the machine name to connect, you will have to change your connection strings. If that's what you are looking for, then yes, it's that easy - no additional steps needed.

That's why you can also use (local) or just "." as shortcuts for the local machine.

Marc

marc_s
If you already have MyServerABC hardcoded somewhere (doh!), just add a DNS alias. As long as the server name in the connection string resolves to the right IP, it will work.
Bill
+3  A: 

Yes, that's correct from a remote connection view if you change MyServerABC to MyServerDEF in connection strings.

There are a few more things to consider (@@SERVERNAME will not change by default for example) so have a look here: How to: Rename a Computer that Hosts a Stand-Alone Instance of SQL Server

Often, you'd use MyServerPermanentAlias as a network DNS entry too so the actual server name is irrelevant.

gbn
Highly recommend the DNS alias method. That way your Operations staff can rename servers or move SQLServer to a different box or whatever. I have even used multiple aliases for different apps, just in case Operations wanted to move a single database off to its own server.
Bill
+1 for the link, we had some new boxes imaged and couldn't figure out why the new boxes with different names were trying to call the server used for the source image. This helped sort it out.
Jason Slocomb