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


@@Servername


@@Servername

Author
Message
Sudhakar
Sudhakar
SSCertifiable
SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)

Group: General Forum Members
Points: 5597 Visits: 1411
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
SSCoach
SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)

Group: General Forum Members
Points: 19235 Visits: 3813
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 (138K reputation)SSC Guru (138K reputation)SSC Guru (138K reputation)SSC Guru (138K reputation)SSC Guru (138K reputation)SSC Guru (138K reputation)SSC Guru (138K reputation)SSC Guru (138K reputation)

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

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

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

Group: General Forum Members
Points: 49742 Visits: 10852
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

Sudhakar
Sudhakar
SSCertifiable
SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)

Group: General Forum Members
Points: 5597 Visits: 1411
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 (224K reputation)SSC Guru (224K reputation)SSC Guru (224K reputation)SSC Guru (224K reputation)SSC Guru (224K reputation)SSC Guru (224K reputation)SSC Guru (224K reputation)SSC Guru (224K reputation)

Group: General Forum Members
Points: 224159 Visits: 33573
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 Veteran
SSC Veteran (292 reputation)SSC Veteran (292 reputation)SSC Veteran (292 reputation)SSC Veteran (292 reputation)SSC Veteran (292 reputation)SSC Veteran (292 reputation)SSC Veteran (292 reputation)SSC Veteran (292 reputation)

Group: General Forum Members
Points: 292 Visits: 369
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



Sudhakar
Sudhakar
SSCertifiable
SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)

Group: General Forum Members
Points: 5597 Visits: 1411
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.
Sudhakar
Sudhakar
SSCertifiable
SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)

Group: General Forum Members
Points: 5597 Visits: 1411
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 (224K reputation)SSC Guru (224K reputation)SSC Guru (224K reputation)SSC Guru (224K reputation)SSC Guru (224K reputation)SSC Guru (224K reputation)SSC Guru (224K reputation)SSC Guru (224K reputation)

Group: General Forum Members
Points: 224159 Visits: 33573
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