Click or drag to resize
Extract T-SQL Object's Body to Separate Script

The Extract T-SQL Object's Body to Separate Script command creates a new SQL document and extract the selected body of the selected CREATE/ALTER procedure, function or view to the new document.

This topic contains the following sections:

Usage

The Extract T-SQL Object's Body to Separate Script command extracts the body of the selected stored procedure, view or function into a separate SQL document.

To extract the selected code:

1. Select CREATE/ALTER PROCEDURE/VIEW/FUNCTION script which you want to extract.

2. On the SQL Enlight->Refactor menu, click Extract T-SQL Object's Body to Separate Script .

3. The Extract T-SQL Object's Body to Separate Script dialog box is displayed.

The resulting SQL script for is displayed in the Preview box.

refactoring-6

4. Review the generated script in the Preview box and modify it if necessary.

5. Click Apply button to apply the changes.

Parameters

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.

See Also

Other Resources