# SHOW CREATE PROCEDURE

Shows the definition, procedure body, and other attributes for a stored procedure.

Refer to [Permissions Matrix](https://docs.singlestore.com/db/v9.1/reference/sql-reference/security-management-commands/permissions-matrix.md) for the required permission.

## Syntax

```sql
SHOW CREATE PROCEDURE [database_name.]procedure_name [WITH ID <variant ID>]
```

## Remarks

* If a [procedure is overloaded](https://docs.singlestore.com/db/v9.1/reference/sql-reference/procedural-sql-reference/overloaded-functions-and-stored-procedures.md), `SHOW CREATE PROCEDURE` requires the procedure's variant ID which is available from [SHOW FUNCTIONS](https://docs.singlestore.com/db/v9.1/reference/sql-reference/procedural-sql-reference/show-functions.md).

## Example - Show the Definition of a Stored Procedure

The following example shows the definition of a stored procedure named `courses_sp`:

```sql
SHOW CREATE PROCEDURE dbExample.courses_sp \G

```

```output

           Procedure: courses_sp
            sql_mode: STRICT_ALL_TABLES,NO_AUTO_CREATE_USER
    Create Procedure: CREATE OR REPLACE PROCEDURE `courses_sp`(course_code text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL, section_number int(11) NULL, number_students int(11) NULL) RETURNS void DEFINER = 's2user'@'%' AS
  DECLARE
    code TEXT = UCASE(course_code);
    num_students INT = number_students + 1;
  BEGIN
    INSERT INTO courses VALUES (code, section_number, num_students);
END;
character_set_client: utf8mb4
collation_connection: utf8mb4_bin
```

## Example - Show the Definition of an Overloaded Stored Procedure

The following shows the output of `SHOW CREATE PROCEDURE` for variant 0 of the `output_type` procedure from [Overloaded Functions and Stored Procedures](https://docs.singlestore.com/db/v9.1/reference/sql-reference/procedural-sql-reference/overloaded-functions-and-stored-procedures.md).

```sql
SHOW CREATE PROCEDURE output_type WITH ID 0;

```

```output
*** 1. row ***
           Procedure: output_type
            sql_mode: STRICT_ALL_TABLES,NO_AUTO_CREATE_USER
    Create Procedure: CREATE OR REPLACE PROCEDURE `output_type`(input int(11) NULL) RETURNS void DEFINER = 'root'@'%' AS
  BEGIN 
    ECHO SELECT "4-byte Integer"; 
  END;
character_set_client: utf8mb4
collation_connection: utf8mb4_bin

```

***

Modified at: March 17, 2026

Source: [/db/v9.1/reference/sql-reference/procedural-sql-reference/show-create-procedure/](https://docs.singlestore.com/db/v9.1/reference/sql-reference/procedural-sql-reference/show-create-procedure/)

(An index of the documentation is available at /llms.txt)
