How to Execute Stored Procedures from a Linked Server

Userlevel 3

To execute Stored Procedures, you will first need to enable RPC and RPC Out in the settings for the Linked Server. You can access the settings by right clicking your created Linked Server in SSMS and going to the properties section, as shown below: 




After enabling RPC and RPC Out, you will use a DECLARE command to execute the Stored Procedure, like the example below: 
DECLARE @RunStoredProcSQL VARCHAR(1000); 
SET @RunStoredProcSQL = 'EXEC GetOAuthAccessToken AuthMode=''APP'''; 
EXEC (@RunStoredProcSQL) AT [Linked Server Name]; 

Our documentation page for our ODBC Drivers goes over this in the Executing Queries page of the Linked Server section. For example, below is our Salesforce ODBC Driver documentation going over this: 

Execute Stored Procedures 

If you have additional questions or need any assistance, please reach out to for further help.

This topic has been closed for comments