sp_execute (Transact-SQL)


THIS TOPIC APPLIES TO:yesSQL Server (starting with 2008)noAzure SQL DatabaseyesAzure SQL Data Warehouse yesParallel Data Warehouse

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.

Topic link icon Transact-SQL Syntax Conventions

-- Syntax for SQL Server, Azure SQL Data Warehouse, Parallel Data Warehouse  
sp_execute handle OUTPUT  
    [,bound_param  ]  [,...n ]  ]  

Is the handle value returned by sp_prepare. handle is a required parameter that calls for int input value.

Signifies the use of additional parameters. bound_param is a required parameter that calls for input values of any data type to signify additional parameters for the procedure.

System_CAPS_ICON_note.jpg Note

bound_param must match the declarations made by the sp_prepareparams value and can be in the form @name = value or value.

System Stored Procedures (Transact-SQL)
sp_prepare (Transact SQL)

Community Additions