How to change the name of the SQL Server.

Hi Experts,
We have recently changed the IP an existing SQL2005 server . Also we have chaged the name and the password. The server can be logged in with the new name and the password ; new IP and new Password. The problem is when I run the query 'Print @@Server', I still get the old server name. Can anyone tell me what the problem might be and possibly how to fix this.

Thanks.
sarika_patalayAsked:
Who is Participating?
 
Chris MangusDatabase AdministratorCommented:
sp_dropserver 'old_name'
go
sp_addserver 'new_name', 'local'
go       
0
 
sarika_patalayAuthor Commented:
cmangus,
I did what you suggested,but I get the following messages.

sp_dropserver 'SQL10'
go
message : SQL10 does not exist

sp_addserver 'SQL2', 'local'
go      
message : SQL2  already exists.

and when I issue a print command  @@servername
message :SQL10

In short, the task failed.

Regards,
Sarika




0
 
Chris MangusDatabase AdministratorCommented:
Have you restarted the SQL service yet?  You have to restart the service after doing this procedure.
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
sarika_patalayAuthor Commented:
I did restart the service, but no avail. I have afeeling that the problem lies in windows registries, but not sure.

any ideas?

0
 
Chris MangusDatabase AdministratorCommented:
The server name that SQL knows about is in sys.servers table.  You could query that table to see what the entries are.

Are you performing this task while logged on as sa or equivalent?
0
 
Chris MangusDatabase AdministratorCommented:
You can also use SELECT SERVERPROPERTY('MachineName'), SERVERPROPERTY ('InstanceName') as an alternative to SELECT @@ServerName.

You may want to restart the entire server to see if this will help the change to take effect.
0
 
sarika_patalayAuthor Commented:
I did all you stated.

The name in sys.servers table is SQL2 , which is the name of the new table. I am logging in as 'sa'.

also : SELECT SERVERPROPERTY('MachineName'), SERVERPROPERTY ('InstanceName') yields null in both the cases.

I did restart the server to, but, that didnt make any difference.

Nevertheless,thanks for the input.
0
 
Chris MangusDatabase AdministratorCommented:
Is this a virtual or clustered server?

At this point, I would probably re-run:

sp_dropserver 'SQL2'
go
sp_addserver 'SQL2', 'local'
go    

...and do another SQL service restart and see if you can get it to run again...

If sys.servers says SQL2, that's really what SQL Server thinks it is.
0
 
sarika_patalayAuthor Commented:
I did all you asked, but still seems to make no difference. Finally, I have decided to un-installed and re-install the SQL server.

Thanks for the input. I'll award you points anyways..

0
 
Chris MangusDatabase AdministratorCommented:
That's very odd that it didn't work.  Sometimes I've had to do it more than once to make it "stick" but I've never had it not totally work.
0
 
CodeManiacCommented:
I've had this problem before too, and I got the same errors. We eventually had to uninstall and reinstall SQL Server.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.