SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


@@Servername


@@Servername

Author
Message
sudhakara
sudhakara
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2256 Visits: 1386
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.
SQL-DBA-01
SQL-DBA-01
SSCertifiable
SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)

Group: General Forum Members
Points: 7870 Visits: 3548
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.
Perry Whittle
Perry Whittle
SSC Guru
SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)

Group: General Forum Members
Points: 50952 Visits: 17653
has this server been renamed at some point?

-----------------------------------------------------------------------------------------------------------

"Ya can't make an omelette without breaking just a few eggs" ;-)
WayneS
WayneS
SSC-Insane
SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)

Group: General Forum Members
Points: 20544 Visits: 10652
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
If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
Links: For better assistance in answering your questions, How to ask a question, Performance Problems, Common date/time routines,
CROSS-TABS and PIVOT tables Part 1 & Part 2, Using APPLY Part 1 & Part 2, Splitting Delimited Strings

sudhakara
sudhakara
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2256 Visits: 1386
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 ?.
Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (93K reputation)SSC Guru (93K reputation)SSC Guru (93K reputation)SSC Guru (93K reputation)SSC Guru (93K reputation)SSC Guru (93K reputation)SSC Guru (93K reputation)SSC Guru (93K reputation)

Group: General Forum Members
Points: 93991 Visits: 33010
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

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
bpflanzer
bpflanzer
SSC-Enthusiastic
SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)

Group: General Forum Members
Points: 132 Visits: 366
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



sudhakara
sudhakara
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2256 Visits: 1386
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.
sudhakara
sudhakara
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2256 Visits: 1386
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.
Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (93K reputation)SSC Guru (93K reputation)SSC Guru (93K reputation)SSC Guru (93K reputation)SSC Guru (93K reputation)SSC Guru (93K reputation)SSC Guru (93K reputation)SSC Guru (93K reputation)

Group: General Forum Members
Points: 93991 Visits: 33010
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

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search