Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

@@ServerName not returning actual server name

Status
Not open for further replies.

TheDrider

Programmer
Jun 27, 2001
110
US
We have a new machine, we'll call it JAK_NEWSERVER, with a default instance of 2000 installed on it. When calling @@ServerName, it properly returns JAK_NEWSERVER.

Now, the admin troupe has rename the server to just NEWSERVER. They like to make changes. This also renamed the SQL ServerName. I can connect to the server fine from several sources using the new server name, so that's not an issue.

The problem is that @@ServerName is still returning the old name with the JAK_ prefix. Any ideas why it's not returning the correct name, or where to fix it?

Thanks
 
Do this.
Code:
exec sp_dropserver 'JAK_NEWSERVER'
go
exec sp_addserver 'NEWSERVER', local
go
Then restart SQL and you should be good to go.

Denny
MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Looks like it should work, thanks! I'll try it once they put the box back online...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top