> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SQL Procedures

*Kinetica* provides support for basic *SQL procedures*, as an executable batch
of SQL statements.  A *SQL procedure* can be executed by two means:

* *on-demand* - called directly by a user
* *scheduled execution* - configured, upon creation, to execute at a
  user-specified interval

> [!NOTE]
>
> Even if a *SQL procedure* is configured for *scheduled execution*, it
> can still be executed directly by a user in *on-demand* fashion.

After the first run, the execution plan for all statements in the
*SQL procedure* will be created and cached to improve performance on future
executions.

If there is an error executing any statement, the *SQL procedure* will stop
immediately and report the error.  If it is invoked via *scheduled execution*,
an alert will be sent to the [alert monitor](https://docs.kinetica.com/content/admin/alerting.md), as
there is no interactive session through which the error could be reported to a
user.  Any database modifications prior to the error will not be rolled back.

> [!NOTE]
>
> If any of the database objects referenced in the *SQL procedure* are
> dropped or modified, the *SQL procedure* will be dropped as well.  This does
> not include any objects created by the *SQL procedure* that are later
> referenced by it.

For execute permission management, see:

* [GRANT Procedure Permission](https://docs.kinetica.com/content/sql/security/grant-procedure-permission.md#sql-security-priv-mgmt-sqlp-grant)
* [REVOKE Procedure Permission](https://docs.kinetica.com/content/sql/security/revoke-procedure-permission.md#sql-security-priv-mgmt-sqlp-revoke)

> [card] [Supported Statements](https://docs.kinetica.com/content/sql/procedure/supported-statements.md)

> [card] [CREATE PROCEDURE](https://docs.kinetica.com/content/sql/procedure/create-procedure.md)

> [card] [ALTER PROCEDURE](https://docs.kinetica.com/content/sql/procedure/alter-procedure.md)

> [card] [EXECUTE PROCEDURE](https://docs.kinetica.com/content/sql/procedure/execute-procedure.md)

> [card] [DROP PROCEDURE](https://docs.kinetica.com/content/sql/procedure/drop-procedure.md)

> [card] [SHOW PROCEDURE](https://docs.kinetica.com/content/sql/procedure/show-procedure.md)

> [card] [Security](https://docs.kinetica.com/content/sql/procedure/security.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.