sqlsim
Skill42 starsChanged 32 days agoMITView on GitHub
Run SQL queries, scripts, or multi-threaded workloads against SQL Server, Azure SQL Database, Azure SQL Managed Instance, or SQL database in Microsoft Fabric using the sqlsim CLI. USE FOR — executing T-SQL ad-hoc or from a `.sql` file; stress / load testing with N threads × R iterations; measuring connection / login / fetch timings; producing JSON metrics for automation; capturing per-query statistics (`-querystats`). DO NOT USE FOR — non-SQL Server engines (MySQL, Postgres, Oracle), or schema generation / data loading (sqlsim runs queries; it does not generate schemas).
In this repository15 other files it gives its agents.
- sqlpysim/AGENTS.mdAGENTS.md
- sqlsim/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- sqlpysim/.github/copilot-instructions.mdCopilot instructions
- sqlsim/.github/copilot-instructions.mdCopilot instructions
- docs/llms.txtllms.txt
- sqlpysimSkill
- sqlsimstudio-load-testSkill
- sqlsimstudio-manual-testSkill
- sqlsimstudioSkill
- sqlsimtools-buildSkill
- sqlsimtools-project-statsSkill
- sqlsimtools-releaseSkill
- sqlpysimSkill
- sqlsimSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Prefer the installed, version-matched copies in the workspace release overlay.
- Very specific: line 15
If the overlay is not installed, for example when this skill comes from an Agent Plugin, use the public copies.
- Distinctive: line 31
If neither exists, stop and report the missing prerequisite.
- Very specific: line 82
Never append 2>&1, >, or | Select-String to a sqlsim invocation.
- Very specific: line 89
Start load tests with a small -n value and scale gradually while monitoring client and server CPU, memory, network, and connection usage.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
sqlsim — SQL workload simulator
Authoritative references (read these before authoring commands)
Prefer the installed, version-matched copies in the workspace release overlay. They match the executable you will run and work offline:
- Consumer-facing agent instructions:
sqlsim/AGENTS.md - User manual:
sqlsim/sqlsim.md - Examples:
sqlsim/examples/
If the overlay is not installed, for example when this skill comes from an
Agent Plugin, use the public copies. They track the latest release, so confirm
an option exists in sqlsim -h before relying on it:
- https://github.com/microsoft/sqlsimtools/blob/main/sqlsim/AGENTS.md
- https://github.com/microsoft/sqlsimtools/blob/main/sqlsim/sqlsim.md
- https://github.com/microsoft/sqlsimtools/tree/main/sqlsim/examples
Installation prerequisite and binary discovery
This plugin supplies agent guidance, not the sqlsim executable. Install a
sqlsim release in the
workspace or install sqlsim on PATH before running a workload.
Resolve the executable in this order:
- Workspace release overlay:
.\sqlsim\x64\sqlsim.exeor.\sqlsim\ARM64\sqlsim.exeon Windows;./sqlsim/x64/sqlsimon Ubuntu. - A
sqlsimexecutable already available onPATH.
If neither exists, stop and report the missing prerequisite. Do not assume the Agent Plugin installation directory contains the executable.
Command shape
sqlsim.exe -S <server> <auth> [-d <database>] [-Q <query> | -i <file>] [-n threads] [-r iters] [-q|-v] [-stream-json] [-json [-o file]]Authentication (exactly one is required):
| Flag | Use case |
-E | Windows SSPI or Linux Kerberos integrated authentication |
-A | Microsoft Entra interactive (Windows only) |
-A ActiveDirectoryIntegrated | Entra integrated (Kerberos ticket required on Linux) |
-A ActiveDirectoryMsi | Managed Identity |
-A ActiveDirectoryServicePrincipal -U <client_id> -P <secret> | Service principal |
-T <token> | Access token — preferred for repeated Azure runs |
-U <user> -P <pwd> | SQL Authentication |
For local applications and automation, use -T - or -P - with redirected stdin to keep secrets out of process arguments.
Canonical patterns
# Smoke — local SQL Server
.\sqlsim\x64\sqlsim.exe -S localhost -E -Q "SELECT @@VERSION"
# Workload — 10 threads × 100 iterations, suppress result sets
.\sqlsim\x64\sqlsim.exe -S localhost -d AdventureWorks -E -i .\workload.sql -n 10 -r 100 -q
# Azure SQL with token (no interactive popup)
$token = az account get-access-token --resource https://database.windows.net --query accessToken -o tsv
$token | .\sqlsim\x64\sqlsim.exe -S myserver.database.windows.net -d mydb -T - -Q "SELECT 1"
# JSON for automation
.\sqlsim\x64\sqlsim.exe -S localhost -E -i .\workload.sql -n 4 -r 50 -json -o results.json
$r = Get-Content results.json | ConvertFrom-Json
# NDJSON progress stream for live consumers
.\sqlsim\x64\sqlsim.exe -S localhost -E -i .\workload.sql -n 4 -r 50 -stream-json
# NDJSON progress plus canonical final JSON
.\sqlsim\x64\sqlsim.exe -S localhost -E -i .\workload.sql -n 4 -r 50 `
-stream-json -json -o final-results.jsonWorkload pattern
Separate logic from execution: a .ps1 invokes sqlsim.exe -i workload.sql. SQL batches are separated by GO. Use -stoponerror to halt all threads on the first failure (default: continue).
Rules
- Resolve the executable using the discovery order above. Do not search source build directories.
- Never append
2>&1,>, or| Select-Stringto a sqlsim invocation. Capture into a variable instead. - Parse JSON results with
ConvertFrom-Json. Compute deltas between phases — never compare cumulative values. - For Azure SQL prefer
-T <token>over-Afor repeated runs. - On Linux, do not use bare
-AorActiveDirectoryInteractive; use-T, Kerberos integrated authentication, managed identity, service principal, or SQL authentication. -querystats-interval <seconds>snapshots query statistics to a file while the run is in progress, implying-querystatsand defaulting toquerystats-live.json. The file is replaced atomically, so it is safe to poll. A write failure never fails the run and is reported once on stderr, but that message is suppressed in-jsonand-stream-jsonmodes; verify the file exists rather than relying on a message or the exit code.- Combine
-stream-jsonwith-json -o <file>to keep live NDJSON on stdout and write the canonical final JSON to the file. The combined mode requires-o. - Certificate validation follows
sqlcmd(Go): neither-Nnor-Cmeans the certificate is not validated,-Nwithout-Crequires validation, and-Cbypasses it. This applies to every authentication mode including-T. For Azure SQL prefer-N m; use-Conly for a self-signed server, or-F <hostname>when the connected name differs from the certificate name. - Start load tests with a small
-nvalue and scale gradually while monitoring client and server CPU, memory, network, and connection usage. High thread counts can exhaust client resources and invalidate results; use a dedicated client for significant load tests.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

