sp_describe_undeclared_parameters
Returns a result set that contains metadata about undeclared parameters in a Transact-SQL batch.
What changes
- Input
- Returns a result set that contains metadata about undeclared parameters in a Transact-SQL batch.
- Output or change
- No write is stated in the Microsoft summary.
Syntax at a glance
sp_describe_undeclared_parameters
[ @tsql = ] 'Transact-SQL_batch'
[ , [ @params = ] N'@parameter_name data_type [ , ... n ]' ]
Work example
Returns a result set that contains metadata about undeclared parameters in a Transact-SQL batch.
Write a proposed call on paper. Name the target, required permission, expected change, and recovery step before any lab use.
Check your work Reports the inferred SQL type for @minimumId without running the SELECT. The caller needs permission to execute the statement being described.
Practice SQL
Open in SQL FlowOpen the SQL for a walkthrough. Run the example in SQL Server to check its result.
EXEC sys.sp_describe_undeclared_parameters @tsql = N'SELECT ProductId FROM (VALUES (101), (202)) AS Products(ProductId) WHERE ProductId >= @minimumId';
Open Microsoft Learn for full syntax, permissions, and details for your version.