A stored procedure is a collection of SQL statements and optional
control-of-flow statements stored under a name.
- In the left pane of the Administration Console, expand, then select Stored Procedures.
- Click the drop-down arrow and select New.
- On the Introduction screen, select the server, database, and owner of the new procedure.
- Enter the name of the procedure.
- (Optional) On the Compile Option screen, you have the option to recompiled your
procedure every time it is executed. This is useful if you expect parameter values to
change frequently. If you do not select this option, the procedure is compiled only
the first time it is executed.
- (Optional) On the Stored Procedure Group screen, you can specify a group number
to which to add the stored procedure. Grouping together all stored procedures that
belong to a certain application lets you drop all procedures with a single
command.
- (Optional) (Available on 15.7 ESD#2 and higher) On the Execution
Behavior screen, select how the procedure will be executed. This feature is not
controlled by the enable granular permissions
configuration option.
- On the SQL Editor screen, provide the SQL statements for the procedure. Ensure that all objects referenced by the procedure exist in the database.
- (Optional) Click Preview to see the SQL statements for your command.
- (Optional) Click Summary to verify your selected options.