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 = 0
SELECT @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
- Error: Something went wrong while signing in. Authentication failed.
- Migrating snippets, styles and SQLHistory to another installation
- Why SQL Prompt?
- About SQL Prompt
- SQL Prompt Requirements
- Installing and running SQL Prompt
- Installing/Activating SQL Prompt from the .msi File
- Managing SQL Prompt behavior
- SSMS Tab Management
- SQL Refactoring