April 25, 2010 at 8:39 am
Hi,
I have named instance in sql server 2000 version. while executing the @@servername command its giving the server name as value "Null".
Can anybody tell me the reason why its giving result like that or is there any issue at server ?
Thanks in Advance.
April 25, 2010 at 10:25 am
Sudhakara ,
That's strange..! The serverproperty gives entire details of the SQL server.
Again cross check the server name from services section.
Refer the link:
http://msdn.microsoft.com/en-us/library/aa933172(SQL.80).aspx
Thanks.
April 25, 2010 at 2:33 pm
has this server been renamed at some point?
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
April 25, 2010 at 8:41 pm
Check out sp_AddServer in BOL.
You'll probably need to run it as:
execute sp_AddServer 'MyServerName', 'LOCAL'
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
April 26, 2010 at 1:00 am
Sourav-657741 (4/25/2010)
Sudhakara ,That's strange..! The serverproperty gives entire details of the SQL server.
Again cross check the server name from services section.
Refer the link:
http://msdn.microsoft.com/en-us/library/aa933172(SQL.80).aspx
Thanks for all,
can you tell what kind of problem may occur if its continues ?.
April 26, 2010 at 6:59 am
Can you get the information running this query?
SELECT CONVERT(sysname, SERVERPROPERTY('servername'));
If not, you may have an issue with the server, it's configuration, your connections... not sure.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 26, 2010 at 7:16 am
I've seen this before- I'd bet your server isn't registered as "local"
Try selecting from master.Sys.servers- (select * from master.sys.servers)
you're local servername should be server_id= 0
if it's not- I think you need to drop and readd
exec sp_dropserver 'myserver'
exec sp_addserver 'myserver',local
Good luck
Ben Pflanzer
April 28, 2010 at 1:33 am
Grant Fritchey (4/26/2010)
Can you get the information running this query?
SELECT CONVERT(sysname, SERVERPROPERTY('servername'));
If not, you may have an issue with the server, it's configuration, your connections... not sure.
Yes. That select statement displaying the name of the server.But here name of the instance and name of the server is different.
Thanks.
April 28, 2010 at 1:41 am
bpflanzer (4/26/2010)
I've seen this before- I'd bet your server isn't registered as "local"Try selecting from master.Sys.servers- (select * from master.sys.servers)
you're local servername should be server_id= 0
if it's not- I think you need to drop and readd
exec sp_dropserver 'myserver'
exec sp_addserver 'myserver',local
Good luck
Ben Pflanzer
Its a named instance in the server. Server id column has value as 1.
April 28, 2010 at 5:47 am
sudhakara (4/28/2010)
Grant Fritchey (4/26/2010)
Can you get the information running this query?
SELECT CONVERT(sysname, SERVERPROPERTY('servername'));
If not, you may have an issue with the server, it's configuration, your connections... not sure.
Yes. That select statement displaying the name of the server.But here name of the instance and name of the server is different.
Thanks.
OK. That's good. Then you can also call the SERVERPROPERTY function with 'InstanceName' to get the instance. If that's accurate, you might be OK.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 28, 2010 at 6:02 am
since the serverid <> 0 it's considered a "remote" server.
for @@servername to return properly- you'll need to drop and add as stated earlier:
If you look up sys.servers in BOL- you'll see this:
Contains a row per linked or remote server registered, and a row for the local server that has server_id = 0.
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply