DATETIME SELECT SELECT INTO DATE PAD STRING DYNAMIC SQL CURSOR MONEY FORMAT PERCENT STORED PROCEDURE SQL SERVER AGENT JOB OPTIMIZATION WHILE LOOP OVER PARTITION BY UPDATE
 
 
SITE SEARCH SQLUSA.com VIDEOS
 
 
SQL E/BOOKS   WORLD, USA & SQL NEWS   FORMAT
SCRIPTS SQL 2005 SQL 2008 ARTICLES
How to execute a stored procedure on a remote server?

The remote server has to be setup as a linked server on Microsoft SQL Server instance. The following 4-part naming (addressing, referencing) will execute the stored procedure on the remote server.

EXEC RemoteServerName.DBName.dbo.NightlyAccountPurge

EXEC [211.132.34.101].DBName.dbo.NightlyAccountPurge

EXECUTE [UKSRVR\SQL2008].master.dbo.sp_who2

EXEC [PRODSRVR\INSTANCENAME].AdventureWorks2008.dbo.uspGetBillOfMaterials 800, '2004-02-15'

The RPC and RPC out server options must be set true for remote procedure execution. It can be done from SSMS Object Explorer Linked Server Properties or by script.

USE [master]
GO
EXEC master.dbo.sp_serveroption @server=N'UKSRVR\SQL2008', @optname=N'rpc', @optvalue=N'true'
GO
EXEC master.dbo.sp_serveroption @server=N'UKSRVR\SQL2008', @optname=N'rpc out', @optvalue=N'true'
GO


Exam Prep 70-461
SQL 2016 DESIGN & PROGRAMMING
 
 
 
DATETIME SELECT SELECT INTO DATE PAD STRING DYNAMIC SQL CURSOR MONEY FORMAT PERCENT STORED PROCEDURE SQL SERVER AGENT JOB OPTIMIZATION WHILE LOOP OVER PARTITION BY UPDATE