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

How can I create then alter a stored procedure for a linked server using sql server 2012?
rhservanAsked:
Who is Participating?
 
QlemoConnect With a Mentor Batchelor, Developer and EE Topic AdvisorCommented:
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
 
rhservanAuthor Commented:
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
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
Creating the procedure on the linked server is exactly what I posted.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.