---
slug: /alter-procedure
---

# ALTER PROCEDURE

`ALTER PROCEDURE` is used to change one or more characteristics of a stored procedure.

The syntax of `ALTER PROCEDURE` is as follows:

```sql
ALTER PROCEDURE proc_name [characteristic ...]

characteristic: {
    COMMENT 'string'
  | LANGUAGE SQL
  | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }
  | SQL SECURITY { DEFINER | INVOKER }
}
```

The `ALTER PROCEDURE` statement cannot be used to change the parameters or body of a stored procedure. To make such changes, you must use `DROP PROCEDURE` and `CREATE PROCEDURE` to drop and recreate the procedure.

You must have the `ALTER PROCEDURE` privilege on the procedure. By default, this privilege is automatically granted to the procedure creator.

The following table describes the characteristics of routine usage of data:

* `CONTAINS SQL` indicates that the routine does not contain statements that read or write data. This is the default value. For example, `SET@x=1` or `DO RELEASE_LOCK('abc')` will be executed but will not read or write data.

* `NO SQL` indicates that the routine does not contain SQL statements.

* `READS SQL DATA` indicates that the routine contains statements that read data (such as `SELECT`) but does not contain statements that write data.

* `MODIFIES SQL DATA` indicates that the routine contains statements that may write data (such as `INSERT` or `DELETE`).

`SQL SECURITY` can be `DEFINER` or `INVOKER`, specifying whether the routine is executed using the privileges of the specified user (who must have access to the database associated with the routine) or the privileges of the caller. The default value is `DEFINER`. The user calling the routine must have the `EXECUTE` privilege on the routine.

Here is an example of `ALTER PROCEDURE`:

```sql
ALTER PROCEDURE proc_name LANGUAGE SQL READS SQL DATA  SQL SECURITY INVOKER COMMENT 'Example';
Query OK, 0 rows affected
```