Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

@@Servername

Status
Not open for further replies.

rinuv

IS-IT--Management
Jul 28, 2000
9
US
Hello!

I'm running SQL 7 and I'm having trouble setting up replication. When I go to configure replication I get a message stating that my server name is null. So, I did @@servername and got null. How do I add my servername?

Thanks in advance for any assistance.
 
Quoting redlam's response on a thread back in June:

"This has happened to me before as well. Usually when the computer name has changed after SQL was installed. Microsoft suggests that you reapply the installation of SQL 7 in order to resolve this problem but that hasn't always worked for me. Instead, I have found that I need to go directly into the sysservers table of the master database and edit the database id. The local server name should have a srvid of 0. I don't usually make it a practice to edit system tables but in this particular situation I have found no other option."

If this works, we should probably make a FAQ of it.
 
Hi Rinuv,

I had this problem before - when I was upgrading a 6.5 db to a 7. The way i got round it was to allow updates to the system tables, and to add an entry. This is from memory and its from about a year ago, but here goes.

You need to do the following:

1) execute the following stored procedure:
exec sp_dboption "allow updates" true (Check syntax in help)

2) run the following SQL in ISQL:

INSERT INTO SYSSERVERS VALUES ("YOURSERVERNAME","",0,0)

3) turn off the updates option on the system table:

exec sp_dboption "allow updates" false

4)STop and start SQL Server

That should do it. You need to check the structure of the master..sysservers table - I don't have a copy of SQL Server a the moment. You need to make sure the serverid is 0 ,0 - I'm sure of that anyway.

HTH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top