|Extract to Separate Script|
The Extract to Separate Script creates a new SQL document and extract the selected code to it.
This topic contains the following sections:
The Extract to Separate Script command extracts the selected script into a new SQL document.
To extract the selected code:
1. Select the script that you want to extract.
2. On the SQL Enlight->Refactor menu, click Extract to Separate Script .
3. The Extract to Separate Script dialog box is displayed.The resulting SQL script for is displayed in the Preview box.
4. Modify the order, the type and the direction of the parameters using the Parameters grid.
5. Review the generated script in the Preview box and modify it if necessary.
6. Click Apply button to apply the changes.
The parameters of the new objects are determined from the variables which are referenced in the selected code.
SQL Enlight automatically resolves the data type and the direction of these parameters. If a variable is used, but declared nowhere in the script, its declaration in the resulting script will have sql_variant data type.