EXECUTE Statement [T-SQL]

Invokes a procedure, as an Adaptive Server Enterprise-compatible alternative to the CALL statement.

Syntax

EXECUTE@return_status = ] [owner.]procedure_name
... { [ @parameter-name = ] expression
| [ @parameter-name = ] @variableoutput ] } ,...

Examples

Usage

EXECUTE executes a stored procedure, optionally supplying procedure parameters and retrieving output values and return status information.

EXECUTE is implemented for Transact-SQL compatibility, but can be used in either Transact-SQL or Sybase IQ batches and procedures.

Note: You cannot reference a Table UDF in an EXECUTE statement.

Permissions

Must be the owner of the procedure, have EXECUTE permission for the procedure, or have DBA authority.

Related reference
CALL Statement