Turn a stored procedure into a script (for testing)
When testing stored procs it's sometimes (or often) required to get the inside of the sproc and test it as a plain script. It would be helpful if SQL Prompt had an option to click a sproc and enable the coder to script it as a script with the input variables declared as plain variables at the head of the script (with maybe default values filled in already). It's something similar to taking script code and making it into a sproc but... the other way round :) It would make life easier for many a dev... Thanks!

This feature was released in version 7.3 of SQL Prompt.
If there are any missing features please let us know by creating a new suggestion.
Kind Regards,
The Prompt Team
-
Gerald Britton commented
Please extend this functionality to functions and views
-
kevriley commented
-
Tom Pester commented
Handy but what I do is let the create script run and prefix the object name with temp so I can make changes without impacting the original sproc
-
Gareth Dirlam (Level Timber Co.) commented
Seems like a great feature to add to SQL Prompt. I do this all the time.
-
Sean commented
This is a duplicate and should be merged with the one above.
-
Sean commented
I do this all the time and it would be quite helpful. I spend a lot of time converting SPs to scripts so I can more easily debug them.
-
kevriley commented
Sometimes when debugging a large lengthy stored procedure, I need to break the code down into logical chunks, adding output and adding temporary, intermediate result sets.
I start off by taking the stored procedure, stripping away the header and creating declare local variable statements to replace the parameter list. Then adding SET statements to set the values.
This seems like the kind of thing that could be automated, and hence added into SQL Prompt