Skip to content

Stored Procedures - Debugging

Prompt 1: Debugging a Stored Procedure

You are debugging a stored procedure in a SQL database. The procedure details are as follows:

Procedure Name: {procedure_name}
Issue Description: {issue_description}

Generate a step-by-step plan to debug the stored procedure, including:
- Identifying the root cause
- Testing the procedure with different inputs
- Fixing the issue

Prompt 2: Logging and Monitoring

You are adding logging and monitoring to a stored procedure to aid in debugging. The procedure details are as follows:

Procedure Name: {procedure_name}

Generate the SQL code to add logging and monitoring, including:
- Logging input parameters
- Capturing execution time
- Recording errors