Execute Procedures Remotely

You can execute procedures on a remote server from your local server.

Once both servers are properly configured, you can execute any procedure on the remote server simply by using the server name as part of the identifier. For example, to execute a procedure named remoteproc on a server named GATEWAY:
exec gateway.remotedb.dbo.remoteproc 

The following examples execute the procedure namelist in the pubs2 database on the GATEWAY server:

execute gateway.pubs2..namelist 
gateway.pubs2.dbo.namelist 
exec gateway...namelist 

The last example works only if pubs2 is your default database.

See, Managing Remote Servers, in the System Administration Guide: Volume 1. You can pass one or more values as parameters to a remote procedure from the batch or procedure that contains the execute statement for the remote procedure. Results from the remote SAP ASE appear on your local terminal.

Use the return status from procedures to capture and transmit information messages about the execution status of your procedures.

Warning!   If Component Integration Services is not enabled, SAP ASE does not treat remote procedure calls (RPCs) as part of a transaction. Therefore, if you execute an RPC as part of a transaction, and then roll back the transaction, SAP ASE does not roll back any changes made by the RPC. When Component Integration Services is enabled, use set transactional rpc and set cis rpc handling to use transactional RPCs. See the Reference Manual: Commands.
Related concepts
Return Status