Write Script MSSQL
Use this skill to draft or review SQL Server scripts with clear sequencing, assumptions, and safety notes.
Clarify First
- Is this for schema change, data correction, reporting, or operational maintenance?
- Will the script run interactively, in CI/CD, or as part of a deployment package?
- What transactional guarantees and downtime constraints matter?
- Are there dependencies on stored procedures, jobs, views, or application versions?
SQL Server Guidance
- Make transaction scope and error-handling intent explicit.
- Think about locking, blocking, and deployment ordering.
- Keep idempotency in mind when scripts may be rerun.
- Be careful with destructive changes, large updates, and dependent objects.
Good Output
- Ordered script structure.
- Notes on SQL Server-specific deployment concerns.
- Validation checks and assumptions.
- Risks around reruns, locking, or object dependencies.
Common Mistakes
- Assuming the script is safe to rerun when it is not.
- Bundling unrelated changes together.
- Ignoring dependency order between objects.
- Making data and schema changes without considering blocking or rollback.
微信扫一扫