You can create a stored procedure from an existing SQL statement
in the Data Project Explorer.
Prerequisite: Before you create a stored procedure using this
method, you must have a SQL statement in the SQL Scripts folder
of a data development project. You can use the SQL tooling in the workbench
to create SQL statements, or you can import them into a project.
To create a stored procedure from an SQL statement:
- Switch to the Data perspective.
- In the Database Explorer, right-click an SQL statement in the SQL
Scripts folder under a data development project, and select Generate
Stored Procedure. A wizard opens, with the SQL
statement initialized to the SQL statement that you selected.
- Complete the steps of the wizard.
The wizard creates the stored procedure and adds it to the Stored
Procedures folder, and the stored procedure opens in the routine
editor.