Solved

What is the best way to create a stored procedure for a Linked Server?

Posted on 2013-12-27
3
382 Views
Last Modified: 2013-12-27
How can I create then alter a stored procedure for a linked server using sql server 2012?
0
Comment
Question by:rhservan
  • 2
3 Comments
 
LVL 68

Accepted Solution

by:
Qlemo earned 500 total points
ID: 39742125
Are you asking for creating and altering the stored procedure on the remote server, or on the local server but using a linked server for some references?

The first needs to be done by dynamic SQL, as you have to be in the DB you create/alter objects (metadata, DDL). Something like
exec srv.db..sp_executesql N'create procedure ...'

Open in new window

0
 

Author Comment

by:rhservan
ID: 39742162
I want to pull the data from the 'linked' server configuration on my localhost through a stored procedure.   Is there someway to create the stored procedure on the Linked Server.  Please elaborate.
0
 
LVL 68

Expert Comment

by:Qlemo
ID: 39742455
Creating the procedure on the linked server is exactly what I posted.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now