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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select @@servername (results NULL) 1

Status
Not open for further replies.

karbon

Programmer
Dec 4, 2003
29
TR
Hi every one.
I have to SQLServers in my computer.
First one SQL Server 7.0 (CEM)
Second one SQL Server 2000 (CEM\SQL2)

When use (select @@servername) in sql2000
Result : CEM\SQL2

But When use (select @@servername) in sql7
Result : NULL

There is no problem when i connect Query Analy. Or Enterprise Manager.
In Enterprise Manager I see both of them with their correct name. CEM and CEM\SQL2

How can i get my @@servername back?....
Where is it recorded? Registry? SQL systemtables?





 
see sp_addserver

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
Thank You very much. I found in sysservers that CEM srvID was 6. But it must be 0 in order to be local server name.

This solved my problem.

sp_dropserver 'CEM'
sp_addserver 'CEM', 'local'
Stop and Start SQL Server.


thanks again.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top