sp_execute (Transact-SQL)

Applies to: SQL Server Azure SQL Managed Instance Azure Synapse Analytics Analytics Platform System (PDW)

Executes a prepared Transact-SQL statement using a specified handle and optional parameter value. sp_execute is invoked by specifying ID = 12 in a tabular data stream (TDS) packet.

Transact-SQL syntax conventions

Syntax

sp_execute handle OUTPUT
    [ , bound_param ] [ , ...n ]
[ ; ]

Arguments

handle

The handle value returned by sp_prepare. The required handle parameter is int, and can't be NULL.

bound_param

Signifies the use of extra parameters. The bound_param parameter is any data type, to signify more parameters for the procedure, and can't be NULL.

Note

bound_param must match the declarations made by the sp_prepare @params value, and can be in the form @name = <value> or <value>.