Geeks With Blogs
Mike Azocar So long and thanks for all the Fish!

I have hit this issue a couple times and I wanted to share my solution with everyone.

I was getting this error in Visual Studio on a stored procedure that referred to a linked server even after I created the linked server.

TSD4001: Could not find server 'XXXX' in sys.servers. Verify that the correct server name was specified. If necessary, execute the stored procedure sp_addlinkedserver to add the server to sys.servers. (SQL error = 7202)    

To fix this, do the following:

  1. In the stored procedure change the name of the linked server to another name that does not exist (i.e. add a 1 to the end) and save.
  2. Change the name back to the original name and save.
  3. The error should be gone.

Happy Coding!

Posted on Tuesday, April 8, 2008 2:27 AM | Back to top

Comments on this post: Weird DB Pro Issue with Linked Servers

# re: Weird DB Pro Issue with Linked Servers
Requesting Gravatar...
I have tried your method and it did not work.
Left by James on Sep 11, 2008 2:20 PM

# re: Weird DB Pro Issue with Linked Servers
Requesting Gravatar...
This worked for me as well and is an indication of DB Pro caching the error state with respect to linked server validity. The detection of a new linked server in the script causes the error cache to get reset. Nice find! A very unfortunate bug.
Left by Martin Douglas on Dec 30, 2008 11:53 PM

Your comment:
 (will show your gravatar)

Copyright © Mike Azocar | Powered by: