Agent skill · software engineering · jeremylongshore
generating-stored-procedures
Use when you need to generate, validate, or deploy stored procedures
Why this skill is useful
Adds executable scripts for generating and managing stored procedures across multiple SQL databases with error handling and transaction management.
What it needs
About 4k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.
What this skill does
Stored Procedure Generator Generate production-ready stored procedures for PostgreSQL, MySQL, and SQL Server with proper error handling, transaction management, and security best practices. Prerequisites Database connection credentials (host, port, database, user, password) Appropriate permissions: CREATE PROCEDURE, CREATE FUNCTION, EXECUTE Target database type identified (PostgreSQL, MySQL, or SQL Server) Instructions Step 1: Identify Database Type and Requirements Determine the target database and procedure requirements: Step 2: Generate Stored Procedure PostgreSQL Function (PL/pgSQL): MySQL Stored Procedure: SQL Server Stored Procedure (T-SQL): Step 3: Add Transaction Management PostgreSQL with Transaction: MySQL with Transaction: Step 4: Validate Syntax Use the validation script to check procedure syntax: Step 5: Deploy to Database Output SQL procedure file with proper syntax for target database Validation report confirming syntax correctness Deployment confirmation with execution results Rollback script for procedure removal Error Handling Error Cause Solution ------- ------- ---------- permission denied Missing CREATE PROCEDURE privilege GRANT CREATE PROCEDURE ON database TO user; syntax error Invalid SQL for database type Use database-specific syntax validator function already exists Procedure exists without OR REPLACE Add OR REPLACE or DROP first undefined column Referenced column doesn't exist Verify table schema before deployment transaction aborted Error during transaction Check EXCEPTION handler and ROLLBACK logic Examples Generate CRUD procedures for a table: Create audit trigger: Resources ${CLAUDESKILLDIR}/references/postgresqlstoredprocedurebestpractices.md ${CLAUDESKILLDIR}/references/mysqlstoredprocedurebestpractices.md ${CLAUDESKILLDIR}/references/sqlserverstoredprocedurebestpractices.md ${CLAUDESKILLDIR}/references/databasesecurityguidelines.md ${CLAUDESKILLDIR}/references/storedprocedureoptimizationtechniques.md Overview Use when you need to gen …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills jeremylongshore/generating-stored-procedures--7bdb8b