sp_unprepare (Transact-SQL)
Applies to:
SQL Server
Azure SQL Managed Instance
Azure Synapse Analytics
Analytics Platform System (PDW)
Discards the execution plan created by the sp_prepare
stored procedure. sp_unprepare
is invoked by specifying ID = 15 in a tabular data stream (TDS) packet.
Syntax
sp_unprepare handle
[ ; ]
Arguments
handle
The handle value returned by sp_prepare
. handle is int.
Examples
The following example prepares, executes, and unprepares a simple statement.
DECLARE @P1 INT;
EXEC sp_prepare @P1 OUTPUT,
N'@P1 NVARCHAR(128), @P2 NVARCHAR(100)',
N'SELECT database_id, name FROM sys.databases WHERE name = @P1 AND state_desc = @P2';
EXEC sp_execute @P1, N'tempdb', N'ONLINE';
EXEC sp_unprepare @P1;
Related content
प्रतिक्रिया
https://aka.ms/ContentUserFeedback.
जल्द आ रहा है: 2024 के दौरान हम सामग्री के लिए फीडबैक तंत्र के रूप में GitHub मुद्दों को चरणबद्ध तरीके से समाप्त कर देंगे और इसे एक नई फीडबैक प्रणाली से बदल देंगे. अधिक जानकारी के लिए, देखें:के लिए प्रतिक्रिया सबमिट करें और देखें