Inline Stored Procedure with OUTPUT parameters
a.higgins
Posts: 90 Bronze 2
The new "Inline stored procedure" command is quite nice, but it does not seem to be able to handle OUTPUT parameters.
When I use it on a procedure with one normal and three OUTPUT parameters, the normal parameter is declared and populated, but the output parameters are never declared.
The resulting script then throws an error: must declare the scalar variable "@Whatever".
When I use it on a procedure with one normal and three OUTPUT parameters, the normal parameter is declared and populated, but the output parameters are never declared.
The resulting script then throws an error: must declare the scalar variable "@Whatever".
Comments
Thanks for giving the beta a test!
Unfortunately we can't reproduce this here, would you be able to send us a reproducible script for both the CREATE and EXEC so we can test against? If it contains sensitive information you can email us at sqlpromptteam@red-gate.com.
Best regards,
Davdi
If I create that stored procedure, open up a new query, and type "Execute spSampleOutput", SQL Prompt will auto-fill the details for me:
Right-clicking spSampleOutput and choosing "Inline stored procedure" generates the following code:
Attempting to execute it, naturally, results in the following error:
Thanks for sending this through! We can reproduce it here and will look into it.
Best regards,
David
It looks like there are 2 issues you're hitting:
1) Autocomplete for execute statements doesn't deal with output parameters properly 2) Inlining an execute statement produces invalid SQL whzen the output parameters aren't specified properly
We've fixed 2) in the latest beta build (7.3.0.437) and will be looking into 1) over the next few days. We've seen your UserVoice request for this here
Thanks again for your feedback.
Harry