How do you handle running SQL scripts across many servers/databases?
Posted by Pawelm_rot@reddit | sysadmin | View on Reddit | 8 comments
I’m curious how others deal with this workflow.
In my job we have many SQL Server instances with multiple environments (dev/test/prod copies). Almost every day we need to update database structures or run batches of scripts across dozens of databases on several servers.
Doing it manually in SSMS was slow and error‑prone, so a few years ago I built an internal tool to speed things up. It lets us load servers, fetch databases, select targets, run scripts in sequence or in parallel, see per‑database success/failure, timeline, dry‑run, etc.
I’m not linking anything here — I’m more interested in the concept than promoting a tool.
My questions to you:
- How do you handle multi‑server / multi‑database updates?
- Do you use custom tools, SSMS, scripts, CI/CD, something else?
- Would features like parallel execution, dry‑run, or execution timeline be useful in your workflow?
- What would be a “must have” vs “nice to have”?
I’d like to understand how others approach this problem and what matters most in real‑world scenarios.
Jawshee_pdx@reddit
I "must have" a filter for these nonsense engagement posts.
MBILC@reddit
This, because you know the next post from them will be the "I built this great tool that improved XYZ by ABC, just sharing it!"
SirLoremIpsum@reddit
And id like for less AI slop bot engagement posts yet here we are
Pawelm_rot@reddit (OP)
It's about language translation. I developed my own software. Since it's very difficult to reach target groups, especially when working solo, I try to gather from conversations with others what their general approach is to the topic versus how I approached it. This allows me to assess whether to continue and develop it or whether it's pointless.
whetu@reddit
Ansible + lowlydba collection.
Burgergold@reddit
Gitlab runner or jenkins
hoop-dev@reddit
what i did was build parameterized runbooks. define the script once, point it at a list of targets, dry-run first then execute. per-target pass/fail log for remediation. the one thing worth adding from day one is an approval step for destructive ops. thought it was overkill until someone almost dropped prod.
Reo_Strong@reddit
I do this via powershell.
Generate the script and the list of servers to run it on, press go, log errors for remediation.