MSSQL, SQL Server, Azure

Microsoft SQL Server/Azure Start Guide

1. Connections

Connection example:

{
  "name": "MSSQL",
  "server": "localhost",
  "driver": "MSSQL",
  "port": 1433,
  "database": "test_db",
  "username": "sa",
  "askForPassword": false,
  "password": "root(!)Password",
  "connectionTimeout": 15
}

1.1 Specific Options

MSSQL driver specific options can be passed using mssqlOptions settings.

{
  "name": "MSSQL",
  "server": "localhost", // You can use 'localhost\\instance' to connect to named instance
  "driver": "MSSQL",
  "port": 1433,
  "database": "test_db",
  "username": "sa",
  "askForPassword": false,
  "password": "root(!)Password",
  "connectionTimeout": 15,
  "mssqlOptions": {
    ... // options
  }
Option keyDefault ValueDescription
abortTransactionOnErrorA boolean determining whether to rollback a transaction automatically if any error is encountered during the given transaction’s execution. This sets the value for XACT_ABORT during the initial SQL phase of a connection.
appNameApplication name used for SQL server logging.
instanceNameThe instance name to connect to. The SQL Server Browser service must be running on the database server, and UDP port 1434 on the database server must be reachable.
useUTCtrueA boolean determining whether or not use UTC time for values without time zone offset (default: true).
encrypttrueA boolean determining whether or not the connection will be encrypted.
tdsVersion7_4The version of TDS to use (default: 7_4, available: 7_1, 7_2, 7_3_A, 7_3_B, 7_4).

You can use any setting defined in See https://github.com/tediousjs/node-mssql/#tedious also extra options defined in Tedious specific options

Breaking changes

v0.19.x

  • Removed deprecated (v0.17.6) sqltools.connections[].dialectOptions in favor of sqltools.connections[].mssqlOptions.

Connection Options

askForPasswordboolean

Ask for password at connection time instead of storing it as plaintext in your settings.

Typeboolean
Default Valuefalse
connectionTimeoutnumber

Connection timeout in seconds.

Typenumber
Default Value15
connectStringstring | null

Connect string. Support for Oracle, PostgreSQL and AWS Redshift.

Typestring or null
cqlOptionsobject | null

See https://docs.datastax.com/en/developer/nodejs-driver/4.1/api/type.ClientOptions/ for more details.

Typeobject or null
Default Value{}
databasestring

Database name.

Typestring
dialectstring

Connection Driver

Typestring
domainstring | null

Connection domain (for MSSQL only).

Typestring or null
driverstring

Connection driver used for this connection.

Typestring
groupstring

Connection group name.

Typestring
mssqlOptionsnull | object

See https://vscode-sqltools.mteixeira.dev/en/drivers/microsoft-sql-server-azure#11-specific-options for more details.

Typenull or object
Default Value{}
Object Properties
PropertyDescriptionType
encrypt

Encrypt connection.

boolean or null
namestring

Connection name.

Typestring
passwordstring | null

Connection password

Typestring or null
portnumber

Port for connection.

Typenumber
previewLimitnumber

Maximum number of records to return in table previews.

Typenumber
Default Value50
serverstring

Server address.

Typestring
Default Value127.0.0.1
usernamestring

Connection username.

Typestring
variablesobject | null

Connection variables in a key/value pair format. Use this property with sqltools.queryParams.enableReplace to replace the variables without prompting.

Typeobject or null
Default Valuenull
Object Properties
PropertyDescriptionType
ads via Carbon Copy‑paste ready CSS & JavaScript patterns with accessibility baked in. ads via Carbon
×