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
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 name (initial catalog). Can be empty to connect without specifying a database.
Authentication
- Windows Authentication
- SQL Authentication
- Azure MFA
Use Windows Authentication (Integrated Security).When true, the current Windows user credentials are used to authenticate.
Connection Pooling
Enable connection pooling for better performance during load tests.When enabled, connections are reused rather than created for each query.
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 * 2in QueryStressSettings constructor - Both MinPoolSize and MaxPoolSize are set to the same value
Connection timeout in seconds. When set to 0, uses the default from QueryStressSettings (15 seconds).
Advanced Options
Declares the application workload type when connecting to a server.Values:
0orReadWrite- Read-write workload (default)1orReadOnly- Read-only workload (routes to secondary replicas in Always On)
Encryption option for the connection.Values:
"Optional"- Encryption is optional (default)"Mandatory"- Encryption is required"Strict"- Strict encryption mode
Whether to trust the server certificate without validation.Set to true for development/testing with self-signed certificates.
Additional connection string parameters to append.Appended to the end of the connection string with a semicolon separator.
Connection String Generation
SQL Query Stress builds the connection string from ConnectionInfo properties usingSqlConnectionStringBuilder. The LoadEngine.cs:45-50 sets additional properties:
Properties Set Automatically
| Property | Value |
|---|---|
| ApplicationName | ”SQLQueryStress” |
| CurrentLanguage | ”English” |
| MinPoolSize | Equal to NumThreads |
| MaxPoolSize | Equal to NumThreads |
Complete Examples
Local Development
SQL Authentication with Encryption
Azure SQL Database
Always On with Read-Only Intent
Testing Connection
TheConnectionInfo class includes a TestConnection() method that validates the connection settings:
- Validates required fields (Server, Login/Password if not using IntegratedAuth)
- Opens a connection using the generated connection string
- Uses
OpenWithoutRetryto 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.