SQL Prompt's Encapsulate As New Stored Procedure feature allows you to create a new stored procedure from selected SQL code.

Parameters will automatically be created from any variables found in the same script. In order for this to work, however, you must ensure that the variables are both declared and their values are set outside of the text you've selected for encapsulation.
In the examples below, the @MyCounter parameter will be added if the text in blue is selected:
DECLARE @MyCounter INT = 0SELECT @MyCounter = 1
DECLARE @MyCounter INT;Set @MyCounter = 5;SELECT @MyCounter = 4;
2
0
Was this article helpful?
1 out of 2 found this helpful
Articles in this section
- Entra ID MFA Authentication
- SQL Prompt installation issues with the SSMS 22 Import Settings flow
- Prompt AI failed to log in
- Unable to access SQL Prompt AI features
- SQL History is blank or greyed out
- SQL Prompt missing from toolbar after installation
- Add SQL History to a shared folder
- Error: Something went wrong while signing in. Authentication failed.
- Installing and running SQL Prompt
- SSMS Tab Management
Add comment
Please sign in to leave a comment.