Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sp_dropserver and sp_addserver not working

I am using SQL Server Express 2008 R2 and I wanted to change the instance name from "machine name"\SQLEXPRESS2008R2 to just "machine name". I ran:

sp_dropserver 'old_name'

go

sp_addserver 'new_name', 'local'

go

Then restarted the SQL Service. Now when I look at

Select @@SERVERNAME --this is correct

But this isn't correct?

Select serverproperty('ServerName') --This still shows old name

So when I try to connect to my instance via SSMS I still have to connect using the old instance name isntead of the new on I just applied? What am I doing wrong? Why is the new name not taking?

Thanks,

S

like image 786
scarpacci Avatar asked May 10 '11 21:05

scarpacci


1 Answers

Yes, rebooting the SQL server worked. now both names show up correctly.

SELECT @@SERVERNAME 

SELECT serverproperty('ServerName') 
like image 84
Paul Avatar answered Sep 27 '22 19:09

Paul