[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2013-12-27
3
Medium Priority
?
404 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 71

Accepted Solution

by:
Qlemo earned 2000 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 71

Expert Comment

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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

649 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