I had to change the computer name from x to y on a sql server 2008 r2. And followed the instructions [http://msdn.microsoft.com/en-us/library/ms143799.aspx]

Now when I select @@servername it shows null.

However when I Query Select * from sys.servers, the new server name is listed..

@@Servername is used in many of stored procs..

link|improve this question
feedback

migrated from stackoverflow.com Sep 20 '10 at 4:31

This question came from our site for professional and enthusiast programmers.

2 Answers

Well, the answer is that you have to specify 'local' when adding the server after deleting.. now it shows the server name

Here is the link.. http://techontip.wordpress.com/2010/01/05/rename-sql-server-2008-single-server-senario/

link|improve this answer
I'm glad you got it solved. You should choose this as the answer to your question. – Jon Sep 17 '10 at 23:48
feedback

Did you restart the SQL Server instance (or the computer itself?).

link|improve this answer
Yes, first the Sql server restart.. and then whole server.. Yet it is showing null – TonyP Sep 17 '10 at 23:02
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.