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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run Procedure Against Link Server (from local server , populate data in local server)

Status
Not open for further replies.

BTrees

IS-IT--Management
Aug 12, 2006
45
CA
Hello Everyone,

I have a local server A and linked Servers link-1, link-2 , link-2 (could be many)

I have one procedure call Proc-1 on local server A. Which runs and fetch data from databases into a local table called Table-1. I need to run this local procedure against all linked server and populated all data in local table.

steps are like
Read/fetch linked server link-1 name
execute local procedure (A.Proc-1) against Link-1 , get all data accordingly and populate table on local (A.Table-1)
repeat this for all linked servers (union/append/add data in local table A.Table

I wonder is there any way to achieve this?

Thanks
 
I expect you could store all of the significant information (linked server name and parameters) in a table and open a cursor to step through the records building an SQL statement to execute using sp_executesql.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top