Benchdog SQL Multi Runner
A VS Code extension for running one SQL script against many SQL Server and Azure SQL databases at once, from saved lists. Each database's run shows how it ended, its messages, the rows its statements changed, its result sets and its errors, and the result sets can be saved as CSV files. A script that may change data asks first. All the work is done by the Benchdog engine (benchdog serve); this extension is the screen.

Run the script open in the editor on any saved list.

A project file keeps the list, its script and how it runs, never a password.
Install
Install it from the Marketplace in VS Code. The Benchdog engine ships inside the package for Windows (x64), so there is nothing else to install and no .NET needed. Mac and Linux are coming. The desktop app and the benchdog command for the same tool are at benchdog.dev.
What it does
- Lists view: a SQL Multi Runner panel in the activity bar lists your saved lists of databases, each with its databases under it. New List (the + button) asks for a name, then for the databases: tick Azure SQL databases from your Benchdog account, or list a server's databases and tick them. The + beside a list adds more, starting on the servers already in it. Right-click a list to rename it, save it as a project file or remove it, and a database to take it off the list or forget its SQL login's password.
- Run: open a
.sql file and press the play button at the top of the editor, or right-click the file in the editor or the Explorer, and pick the list; or press the play button beside a list to run the open script on it. A script that uses a word that may change something, such as UPDATE, DROP or a procedure call, asks first, with how many databases it runs on. The script runs as it is in the editor, unsaved changes and all, split on GO as SSMS does, four databases at a time.
- Run tab: one per list. It shows each database with a coloured tag (green succeeded, red failed, amber stopped part way, grey not run), how long it took, the batches that ran and the rows changed, then its messages in order (PRINT, rows affected and errors) and its result sets as tables, with the first 1,000 rows of each. An error's Line link opens the script at that line. Stop ends the run: the databases running stop, rolling back their transaction when there is one, and no more start.
- How it runs: the switches and boxes at the top are kept with the list. Transaction per database runs each database's script in one transaction, rolled back when a batch fails, so a database gets all of it or none. Stop on first error starts no more databases once one has failed; a batch that fails always stops the rest of the script in its database. Timeout limits each batch, and At a time sets how many databases run together.
- Save as CSV: writes the result sets to a folder, the same result set from every database in one file with the server and database first on each row, when their columns match.
- Project files: a
.multirunner.json file keeps a list (its name, databases and how it runs) and the script beside it, to run again from VS Code, the benchdog sql run --project CLI or the desktop app. Right-click a list and choose Save as Project File...; the open script goes with it. Open one to get IntelliSense, its problems in the Problems panel, and an Open List link at the top; Open List adds it to the Lists view and opens its script. A project file never holds a password.
- Sign in and SQL logins work as in the other Benchdog SQL tools: your Benchdog account for Azure SQL, your Windows account for SQL Server on your network, or a SQL login whose password Benchdog keeps until VS Code closes or, if you choose, in the system's secure store. The eye on the password box shows what you typed.
Settings
| Setting |
Does |
benchdogMultiRunner.enginePath |
Full path to the benchdog executable. Empty uses the one that ships with the extension. |
benchdogMultiRunner.tenant |
Tenant id to search for Azure SQL databases. Empty means your home tenant. |
benchdogMultiRunner.useAzureCli |
Sign in to Azure SQL through your existing az login instead of the browser. |
The settings are separate from the other Benchdog extensions', so they can all be installed together.
How it stays safe
- Every database is reached as you. The extension keeps only each list's name, its databases' servers, names and how to sign in, and how its scripts run; never a password.
- A script that may change something asks first and says how many databases it runs on. With Transaction per database, a database where a batch fails is rolled back.
- Error messages have row values taken out. Names and values are set as text on the page, so nothing from a database can become markup. The tab is thrown away when hidden.
Diagnostics
Turn on the benchdogMultiRunner.diagnostics setting to have the engine write a debug log of what it does, for finding out why something went wrong. Run Benchdog SQL Multi Runner: Open Diagnostics Logs Folder to see the logs. Passwords, connection strings, tokens and your data are never written.
Trial and licence
Every Benchdog tool has a thirty day trial with every feature and no card: ask for one at benchdog.dev/trial. One licence is for one person and covers the VS Code extension, the desktop app and the command line, on every machine you work from. Prices are at benchdog.dev/pricing. The licence is checked offline; the tool contacts benchdog.dev only when you ask it to, never in the background. The terms are in LICENSE.md and at benchdog.dev/terms.
Help and support
Getting started, how to do the common jobs, the questions people ask and what to try when something goes wrong: benchdog.dev/help/multirunner. Something else? The support form, or support@benchdog.dev, and a person replies.
| |