|
sql
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
@@SERVERNAME returns NULL value... Can we adjust so that it returns the server name
select @@SERVERNAME we are getting a NULL value back. According to BOL ... the information in returned by @@SERVERNAME may be different than the SERVERNAME property of SERVERPROPERTY function. The SERVERNAME property automatically reports changes in the network name of the computer. In contrast, @@SERVERNAME does not report such changes. @@SERVERNAME reports changes made to the local server name using the sp_addserver or sp_dropserver stored procedure Assuming that my server name is XYZ - I would assume that by executing the following command we would be OK: use master go sp_addserver 'XYZ', 'local' go But when executing this - we get the following message: Server already exists. Can someone advise the correct way to do this? Thanks, Tom Hi,
Try this sp_dropserver 'XYZ' go sp_addserver 'XYZ', 'local' go After this stop and start the MS SQL Server service. Then login in Query analyzer and execute SELECT @@SERVERNAME Thanks Hari SQL Server MVP Show quoteHide quote "TJT" <TJT@nospam.com> wrote in message news:O9QwWELiFHA.1244@TK2MSFTNGP14.phx.gbl... > We are running SQL 2000 in a non-clustered server. For some reason when > we > select @@SERVERNAME we are getting a NULL value back. According to BOL > ... > the information in returned by @@SERVERNAME may be different than the > SERVERNAME property of SERVERPROPERTY function. The SERVERNAME property > automatically reports changes in the network name of the computer. In > contrast, @@SERVERNAME does not report such changes. @@SERVERNAME reports > changes made to the local server name using the sp_addserver or > sp_dropserver stored procedure > > Assuming that my server name is XYZ - I would assume that by executing the > following command we would be OK: > > use master > go > > sp_addserver 'XYZ', 'local' > go > > But when executing this - we get the following message: > Server already exists. > > Can someone advise the correct way to do this? > > Thanks, > Tom > > > > > > Hi Hari,
I have the same scenario as below, and I have even try to do two times server restart also, but @@servername still returns Null to me, which is different result from SERVERNAME property of SERVERPROPERTY function. Any idea what else we can try? Thanks in advance! Regards, JC Show quoteHide quote "Hari Prasad" wrote: > Hi, > > Try this > > > sp_dropserver 'XYZ' > go > sp_addserver 'XYZ', 'local' > go > > After this stop and start the MS SQL Server service. Then login in Query > analyzer and execute SELECT @@SERVERNAME > > Thanks > Hari > SQL Server MVP > > > "TJT" <TJT@nospam.com> wrote in message > news:O9QwWELiFHA.1244@TK2MSFTNGP14.phx.gbl... > > We are running SQL 2000 in a non-clustered server. For some reason when > > we > > select @@SERVERNAME we are getting a NULL value back. According to BOL > > ... > > the information in returned by @@SERVERNAME may be different than the > > SERVERNAME property of SERVERPROPERTY function. The SERVERNAME property > > automatically reports changes in the network name of the computer. In > > contrast, @@SERVERNAME does not report such changes. @@SERVERNAME reports > > changes made to the local server name using the sp_addserver or > > sp_dropserver stored procedure > > > > Assuming that my server name is XYZ - I would assume that by executing the > > following command we would be OK: > > > > use master > > go > > > > sp_addserver 'XYZ', 'local' > > go > > > > But when executing this - we get the following message: > > Server already exists. > > > > Can someone advise the correct way to do this? > > > > Thanks, > > Tom > > > > > > > > > > > > > > >
Other interesting topics
My Transaction Log size very strange
Sql Server 2000 administration DBPROCESS is dead or not enabled New to SQL -- Any good reads? Password Error... while installing SQL SP 3a Managing XML field with Enterprise Manager Audit in SQL Server database restore - msdb Does anyone know if guest account must be enabled? Question |
|||||||||||||||||||||||