Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


@@Servername


@@Servername

Author
Message
sudhakara
sudhakara
SSChasing Mays
SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)

Group: General Forum Members
Points: 622 Visits: 1383
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
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: 2316 Visits: 3164
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
SSCrazy Eights
SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)

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

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

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

Group: General Forum Members
Points: 6230 Visits: 10398
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
SSChasing Mays
SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)

Group: General Forum Members
Points: 622 Visits: 1383
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
SSCoach
SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)

Group: General Forum Members
Points: 17553 Visits: 32253
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
Valued Member
Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)

Group: General Forum Members
Points: 74 Visits: 361
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
SSChasing Mays
SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)

Group: General Forum Members
Points: 622 Visits: 1383
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
SSChasing Mays
SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)SSChasing Mays (622 reputation)

Group: General Forum Members
Points: 622 Visits: 1383
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
SSCoach
SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)

Group: General Forum Members
Points: 17553 Visits: 32253
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