Home All Groups Group Topic Archive Search About

@@servername returns NULL

Author
4 May 2006 11:53 AM
Yan
Hi,

sql server 2000 sp3a

select @@servername returns null  but
select * from sysservers shows the correct servername. This causes problems
to set up replication.

Any idea how to resolve apart of reinstalling?


Thanks
Yan

Author
4 May 2006 11:59 AM
ML
Look up sp_dropserver and sp_addserver system procedures in Books Online.

Have you renamed the server recently? (either the machine or the SQL Server
instance)


ML

---
http://milambda.blogspot.com/
Are all your drivers up to date? click for free checkup

Author
4 May 2006 12:17 PM
Yan
Thanks, I found the problem when I used sp_addserver I did not add the
second param @local so the result is that master..sysservers has no row with
a srvrid 0 which should represent the local server.

Thanks.


Show quoteHide quote
"ML" <M*@discussions.microsoft.com> wrote in message
news:CB9D38F6-E2F0-43F3-84C2-CF5DEA8AF8C8@microsoft.com...
> Look up sp_dropserver and sp_addserver system procedures in Books Online.
>
> Have you renamed the server recently? (either the machine or the SQL
> Server
> instance)
>
>
> ML
>
> ---
> http://milambda.blogspot.com/
Author
4 May 2006 12:25 PM
ML
Yeah, those darn extra parameters... :)


ML

---
http://milambda.blogspot.com/
Author
4 May 2006 12:08 PM
Paul Ibison
Yan,

please try:

Use Master
go
Sp_DropServer 'OldName'
GO
Use Master
go
Sp_Addserver 'NewName', 'local'
GO
Stop and Start SQL Services

  Cheers,
           Paul Ibison SQL Server MVP, www.replicationanswers.com
             (recommended sql server 2000 replication book:
             http://www.nwsu.com/0974973602p.html)

Bookmark and Share

Post Thread options