sql server - sp_dropserver and sp_addserver not working -


i using sql server express 2008 r2 , wanted change instance name "machine name"\sqlexpress2008r2 "machine name". ran:

sp_dropserver 'old_name'  go  sp_addserver 'new_name', 'local'  go 

then restarted sql service. when @

select @@servername --this correct 

but isn't correct?

select serverproperty('servername') --this still shows old name 

so when try connect instance via ssms still have connect using old instance name isntead of new on applied? doing wrong? why new name not taking?

thanks,

s

this books online:

although @@servername function , servername property of serverproperty function may return strings similar formats, information can different. servername property automatically reports changes in network name of computer.

in contrast, @@servername not report such changes. @@servername reports changes made local server name using sp_addserver or sp_dropserver stored procedure.

and first comment correct. you'd have reinstall sql in order change default instance.

per bol if change machine name named instances have use follows:

sp_dropserver <'old_name\instancename'> go sp_addserver <'new_name\instancename'>, local go 

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -