Skip to content

Extract to Separate Script

The Extract to Separate Scriptcreates a new SQL document and extracts the selected code from it.

The Extract to Separate Scriptcommand 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->Refactormenu, click Extract to Separate Script.

  3. The Extract to Separate Scriptdialog box is displayed.

The resulting SQL script is displayed in the Previewbox.

refactoring-7

  1. Modify the order, the type and the direction of the parameters using the Parameters grid.

  2. Review the generated script in the Previewbox and modify it if necessary.

  3. Click Applybutton to apply the changes.

The parameters of the new objects are determined from the variables which are referenced in the selected code.

SQL Enlightautomatically 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_variantdata type.

Refactoring