Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Linked Server does not work from VB.NET program

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-01-14 : 13:32:37
Developer123 writes "Hi,

I have 2 SQL Servers. I have a stored procedure written in SQL Server 1 which -
1. creates a Linked Server to SQL Server 2.
2. Performs a Select on a table on SQL Server 2.
3. Drops the linked server connection.

This stored procedure executes successfully on Query Analyzer.

The problem is:
When I call this Stored proc from a VB.NET code in a call to FillDataSet (with the same login as used in Query Analyzer), I get an error...
"Could not find server 'ServerName' in sysservers. Execute sp_addlinkedserver to add the server to sysservers."

Linked server should be established in the stored proc. Since this executes successfully on Query Analyzer,
why not from the code?

Any inputs/suggestions would be highly appreciated!

Thanks in advance!!"
   

- Advertisement -