Skip to main content
The ConnectionInfo class defines how SQL Query Stress connects to SQL Server databases. You’ll configure connection options for both the main database (where queries execute) and optionally for the parameter database (where parameter values are retrieved).

Basic Connection Properties

Server
string
default:"(local)"
SQL Server instance name or hostname.Examples:
  • "(local)" - Default local instance
  • ".\\SQLEXPRESS" - Named instance on local machine
  • "server.domain.com" - Remote server
  • "server.database.windows.net" - Azure SQL Database
Database
string
default:""
Database name (initial catalog). Can be empty to connect without specifying a database.
"Database": "Northwind"

Authentication

IntegratedAuth
bool
default:"true"
Use Windows Authentication (Integrated Security).When true, the current Windows user credentials are used to authenticate.
{
  "Server": ".\\SQLEXPRESS",
  "Database": "Northwind",
  "IntegratedAuth": true
}

Connection Pooling

EnablePooling
bool
default:"true"
Enable connection pooling for better performance during load tests.When enabled, connections are reused rather than created for each query.
MaxPoolSize
int
default:"0"
Maximum connection pool size. When set to 0, uses SQL Server default.For load tests, this is automatically configured based on the number of threads:
  • Set to NumThreads * 2 in QueryStressSettings constructor
  • Both MinPoolSize and MaxPoolSize are set to the same value
ConnectTimeout
int
default:"0"
Connection timeout in seconds. When set to 0, uses the default from QueryStressSettings (15 seconds).
{
  "EnablePooling": true,
  "MaxPoolSize": 2,
  "ConnectTimeout": 15
}

Advanced Options

ApplicationIntent
ApplicationIntent
default:"ReadWrite"
Declares the application workload type when connecting to a server.Values:
  • 0 or ReadWrite - Read-write workload (default)
  • 1 or ReadOnly - Read-only workload (routes to secondary replicas in Always On)
EncryptOption
string
default:"Optional"
Encryption option for the connection.Values:
  • "Optional" - Encryption is optional (default)
  • "Mandatory" - Encryption is required
  • "Strict" - Strict encryption mode
TrustServerCertificate
bool
default:"false"
Whether to trust the server certificate without validation.Set to true for development/testing with self-signed certificates.
AdditionalParameters
string
default:""
Additional connection string parameters to append.Appended to the end of the connection string with a semicolon separator.
"AdditionalParameters": "MultipleActiveResultSets=True;PacketSize=8192"

Connection String Generation

SQL Query Stress builds the connection string from ConnectionInfo properties using SqlConnectionStringBuilder. The LoadEngine.cs:45-50 sets additional properties:
var builder = new SqlConnectionStringBuilder(connectionString)
{
    MinPoolSize = threads,
    MaxPoolSize = threads,
    CurrentLanguage = "English"
};

Properties Set Automatically

PropertyValue
ApplicationName”SQLQueryStress”
CurrentLanguage”English”
MinPoolSizeEqual to NumThreads
MaxPoolSizeEqual to NumThreads

Complete Examples

Local Development

{
  "MainDbConnectionInfo": {
    "Server": ".\\SQLEXPRESS",
    "Database": "Northwind",
    "IntegratedAuth": true,
    "ConnectTimeout": 15,
    "EnablePooling": true,
    "MaxPoolSize": 2,
    "ApplicationIntent": 0
  }
}

SQL Authentication with Encryption

{
  "MainDbConnectionInfo": {
    "Server": "prodserver.domain.com",
    "Database": "Production",
    "IntegratedAuth": false,
    "Login": "sqluser",
    "Password": "P@ssw0rd",
    "ConnectTimeout": 30,
    "EnablePooling": true,
    "MaxPoolSize": 10,
    "EncryptOption": "Mandatory",
    "TrustServerCertificate": false,
    "ApplicationIntent": 0
  }
}

Azure SQL Database

{
  "MainDbConnectionInfo": {
    "Server": "myserver.database.windows.net",
    "Database": "mydb",
    "IntegratedAuth": false,
    "Login": "azureuser",
    "Password": "AzureP@ss123",
    "ConnectTimeout": 30,
    "EnablePooling": true,
    "MaxPoolSize": 20,
    "EncryptOption": "Mandatory",
    "ApplicationIntent": 0
  }
}

Always On with Read-Only Intent

{
  "MainDbConnectionInfo": {
    "Server": "ag-listener.domain.com",
    "Database": "ReportingDB",
    "IntegratedAuth": true,
    "ConnectTimeout": 15,
    "EnablePooling": true,
    "MaxPoolSize": 5,
    "ApplicationIntent": 1
  }
}

Testing Connection

The ConnectionInfo class includes a TestConnection() method that validates the connection settings:
public bool TestConnection()
This method:
  • Validates required fields (Server, Login/Password if not using IntegratedAuth)
  • Opens a connection using the generated connection string
  • Uses OpenWithoutRetry to avoid connection retry logic during testing
  • Returns true if connection succeeds, false otherwise
Connection validation is performed automatically in the GUI and CLI before starting load tests.

Build docs developers (and LLMs) love