Solved

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

Posted on 2013-12-27
3
388 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 69

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 69

Expert Comment

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

Featured Post

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

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

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

790 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