…Could not find server in sysservers.

Wow!  It has been an incredibly busy time these last few weeks since my last post. Unfortunately that hasn’t left me a lot of time outside of work to do much that is techy.

And work unfortunately has seen me doing more and more work with SQL, and that did lead to one interesting situation I thought I would share.

We had successfully installed our application on a client’s computer, and then a few weeks later the clients IT staff renamed the PC. This caused our application to fail with an error of:

…could not find server in sysservers. Execute sp_addlinkedserver to add the server to sysservers…

when we tried to launch it. After much hair pulling the solution we came upon was to run these two scripts:

Use Master

GO

Select @@Servername

This returned the current server name:

Then we used:

Use Master

GO

Sp_DropServer ‘ServerName’

GO

Use Master

GO

Sp_Addserver ‘ServerName’, ‘local’

GO

Then restarted the SQL Services. This reinserted the correct record into the sysservers table, and our application was able to successfully start.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s