Skip to main content

Overview

The sqlstresscmd command-line tool allows you to run SQL Query Stress tests from the terminal without using the GUI. All test configuration is provided via a JSON settings file.

Basic Usage

sqlstresscmd -s <settings-file> [options]

Command-Line Options

-s, --settingsFile
string
required
Path to the JSON settings file containing test configuration. The test will not run without a valid settings file.Example:
sqlstresscmd -s mytest.json
-d, --dbserver
string
Database server to connect to. This overrides the server specified in the settings file.Example:
sqlstresscmd -s mytest.json -d localhost\SQLEXPRESS
-t, --threads
integer
Number of concurrent threads to use for the load test. Overrides the NumThreads value in the settings file.Default: 1Example:
sqlstresscmd -s mytest.json -t 32
-i, --input
string
Path to a .sql script file to execute. This allows you to specify the query from a file instead of embedding it in the JSON settings.Example:
sqlstresscmd -s mytest.json -i query.sql
-x, --xtract
boolean
Extract the sample configuration file (sample.json) to the current directory. Use this to generate a template configuration file.Example:
sqlstresscmd -x
This will create sample.json in the current directory if it doesn’t already exist.
-r, --results
string
Path to automatically save test results to a file.
This feature is planned but not yet implemented.
Example:
sqlstresscmd -s mytest.json -r results.txt

Complete Examples

Run a basic load test

sqlstresscmd -s saved.json -t 32
Runs the test defined in saved.json with 32 concurrent threads.

Override database server

sqlstresscmd -s mytest.json -d prod-server.database.windows.net -t 16
Runs the test against a different server than specified in the settings file.

Use external SQL file

sqlstresscmd -s config.json -i complex-query.sql -t 8
Executes the query from complex-query.sql instead of the query in the settings file.

Generate sample configuration

sqlstresscmd -x
Creates sample.json in the current directory with all available configuration options.

Help Command

To display built-in help information:
sqlstresscmd --help
Output:
Check for updates at: https://github.com/ErikEJ/SqlQueryStress
Sample usage:
sqlstresscmd -s saved.json -t 32

  -s, --settingsFile    File name of saved session settings
  -d, --dbserver        Database Server
  -t, --threads         Number of threads, default 1
  -i, --input           Path to .sql script to execute
  -x, --xtract          Extract sample.json file to current folder
  -r, --results         Autosave results to specified file
  --help                Display this help screen
  --version             Display version information

Error Handling

If the settings file is not found or invalid:
Settings file could not be found, or not specified: <filename>
Make sure the file path is correct and the file exists before running the command.

Build docs developers (and LLMs) love