Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

Linked Server Error when Stored Procedure runs but direct query works ????

$
0
0

Morning all,

I have a linked server that has been in use and worked fine.

Last weekend, we did a migration to a faster server, and it was requested that I use a DNS name for the server.

So instead of using the Server Name of AE-01-032 I used Prod-SQL.

I dropped and recreated the object by using the script to drop and create object, I modified the datasource and all was good.

I ran a test query Select * From prodsql.myDatabase.dbo.myTable and received the data I was looking for.

I thought all was good.

Problem occurrs when my Stored procedure that uses this linked server runs.

I get "Error 7202" Could not find prodsql in sys.servers, but when I query the table, the information is there.

Is my problem that I used an alias for the datasource?

I am switching my datasource name back to AE-01-032 to see if I still get the error.

But why can I get results with a direct query and not using the procedure?

Do I have to make a whole new named linked server to make it work or is changing the Datasource back to AE-01-032 going to work.

And why?

Any help is appreciated.

Tonya


Viewing all articles
Browse latest Browse all 8428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>