Creating a Stored Procedure

A stored procedure is a collection of SQL statements and optional control-of-flow statements stored under a name.

  1. In the left pane of the Administration Console, expand ASE Servers > Compiled Objects > Procedures, then select Stored Procedures.
  2. Click the drop-down arrow and select New.
  3. On the Introduction screen, select the server, database, and owner of the new procedure.
  4. Enter the name of the procedure.
  5. (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.
  6. (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.
  7. (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.
  8. On the SQL Editor screen, provide the SQL statements for the procedure. Ensure that all objects referenced by the procedure exist in the database.
  9. (Optional) Click Preview to see the SQL statements for your command.
  10. (Optional) Click Summary to verify your selected options.
Related concepts
Extended Stored Procedures
Enabling Granular Permissions
Related tasks
Creating a SQLJ Procedure
Related reference
Stored Procedure Properties