Running a multi-statement SQL script through the sql-server server as one transaction, dry run before commit. Use when a change needs several statements to land together on a sql-server registration, or a script run rolled back. Not for one statement: the write-rows skill.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Run Scripts?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/melodic-software-run-scripts)
---
name: run-scripts
description: "Running a multi-statement SQL script through the sql-server server as one transaction, dry run before commit. Use when a change needs several statements to land together on a sql-server registration, or a script run rolled back. Not for one statement: the write-rows skill."
disable-model-invocation: false
---
# Run scripts
## First, check the tool list
Scripts run only through `script_dry_run` and `script_commit`. When those two tools are not in
your tool list, this registration has no script tier: tell the person the script cannot run
through it, and stop. Never emulate the script with `write` calls. The tier exists so a script
lands as one transaction, and each `write` call commits on its own, so a failure partway through
leaves the earlier statements applied.
## The contract
- Pass the script text exactly as written. Never edit, reorder, split or reformat it to suit the
tool; when it cannot run as written, tell the person what would need to change and let them
change it.
- Dry run first, with `script_dry_run`. It executes every statement inside a transaction that
rolls back, so on a shared environment the script still runs against live data while it runs.
Show the person the script, the environment and the database, and have them approve the dry run
as well as the commit.
- Show the person the dry run's result before any commit. `script_commit` ties a commit to its
matching dry run; take how it does that from the tool's own description, and every argument
name from its input schema.
- When a commit's effect differs from its dry run, the commit rolls back. The next step is a new
dry run shown to the person, never a second commit.
- Never retry a commit on its own, after an error, a timeout or a rollback. Read the result's
message and `next` step, learn the state with a read, and go back to the person.
## Next
- The script committed and the person wants the result checked: the query-safely skill.
- The change turns out to be a single statement: the write-rows skill.
## Related
- No sql-server registration is available, or a call reports that the config is invalid: the setup skill.
## Gotchas
- Many script runs end rolled back, because every dry run does. A rolled-back dry run is the
dry run working; read its result before treating it as a failed script.
- A script split into `write` calls loses its single transaction. When the script tools are
missing, the answer is to stop, not to split.