Auto generate parameters based on a scan of a query
I tend to debug SSRS queries/scripts quite a lot in SSMS. Usually these queries contain 1-10 parameters. It would save large amounts of time if I can paste the query into SSMS and run some SQL Prompt command to auto generate at the top of the query all the parameter declarations ready for default values.
-
Robert V commented
It would be also fine to have a function to create new query window from a subquery preserving the variable declarations. It will help with the debugging of a query. Use case: I copy a parameterized SQL query from an asp.net project for example. By clicking a context menu item sql prompt would pick the parameters from the query, check their types and declare them before. Then if I select a part of the query by highlighting the text, by another context menu item sql prompt could copy it to another windows with copying the parameter declarations as well, making able to fine tune the subquery.