Export (0) Print
Expand All
Expand Minimize

sp_prepare (Transact SQL)

SQL Server 2008

Prepares a parameterized Transact-SQL statement and returns a statement handle for execution. sp_prepare is invoked by specifying ID = 11 in a tabular data stream (TDS) packet.

Topic link iconTransact-SQL Syntax Conventions

sp_prepare handle OUTPUT, params, stmt, options

handle

Is a SQL Server-generated prepared handle identifier. handle is a required parameter with an int return value.

params

Identifies parameterized statements. The params definition of variables is substituted for parameter markers in the statement. params is a required parameter that calls for an ntext, nchar, or nvarchar input value. Input a NULL value if the statement is not parameterized.

stmt

Defines the cursor result set. The stmt parameter is required and calls for an ntext, nchar, or nvarchar input value.

options

An optional parameter that returns a description of the cursor result set columns. options requires the following int input value.

Value

Description

0x0001

RETURN_METADATA

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft