A stored procedure can be executed either by an RPC command or by an execute language statement. Remote procedure calls have a few advantages over execute statements:
An RPC command can be used to execute an Adaptive Server Enterprise stored procedure or an Open Server registered procedure.
A Transact-SQL language command can be used only to execute an Adaptive Server Enterprise stored procedure (unless the Open Server application understands Transact-SQL).
An RPC command passes the stored procedure’s parameters in their native datatypes, in contrast to the execute statement, which passes parameters in character format, within the text of the language command. This difference means that the RPC method is faster and more efficient than the execute method, because it does not require either the application program or the server to convert between native datatypes and their character-format equivalents.
It is simpler and faster to accommodate stored procedure return parameters if the procedure is invoked with an RPC command instead of a language command.
With an RPC command, the return parameter values automatically become available to the application as a parameter result set. (A return parameter must be specified as such when it is originally added to the RPC command stream with ct_param or ct_setparam.)
With an execute statement, on the other hand, the return parameter values are available only if the language command declares local variables and passes these variables (not constants) for the return parameters. Because the language command contains more than one SQL statement, this technique involves additional parsing each time the language command is executed.