Skip to content

MSSQL

Reads data from Microsoft SQL Server tables.

Configuration

yaml
source:
  kind: mssql
  connection_string: ${MSSQL_CONNECTION_STRING}
FieldDefaultDescription
connection_string(required)ADO.NET connection string
tables(auto-discover)Optional list of tables to ingest
batch_size_rows10000Rows per ingest batch

Namespace: mssql.{database}.{schema}.{table}

CLI

bash
skippr connect source mssql \
  --connection-string '${MSSQL_CONNECTION_STRING}'

Or run without flags to be prompted interactively.

FlagDescription
--connection-stringADO.NET connection string. Use ${ENV_VAR} to reference an environment variable.

Using ${MSSQL_CONNECTION_STRING} keeps the actual credentials out of the config file and reads the value from your environment at runtime.

Config output

Running connect source mssql writes the following to skippr.yaml:

yaml
source:
  kind: mssql
  connection_string: ${MSSQL_CONNECTION_STRING}

Authentication

VariableDescription
MSSQL_CONNECTION_STRINGADO.NET connection string for SQL Server

Connection string format

bash
export MSSQL_CONNECTION_STRING="server=tcp:127.0.0.1,1433;database=testdb;user id=sa;password=YourPass;TrustServerCertificate=true"

Common parameters:

ParameterDescription
serverHostname and port (e.g. tcp:myserver.database.windows.net,1433)
databaseDatabase name
user idSQL Server login
passwordLogin password
TrustServerCertificateSet to true for self-signed certs (dev/test)
EncryptSet to true for Azure SQL or production (default varies by driver)

Azure SQL

For Azure SQL Database, use the fully qualified server name:

bash
export MSSQL_CONNECTION_STRING="server=tcp:myserver.database.windows.net,1433;database=mydb;user id=myuser@myserver;password=MyPass;Encrypt=true;TrustServerCertificate=false"

Local dev with Docker

Spin up a local MSSQL instance for testing:

bash
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=YourStrong!Passw0rd' \
  -p 1433:1433 --name mssql-dev \
  -d mcr.microsoft.com/mssql/server:2022-latest
bash
export MSSQL_CONNECTION_STRING="server=tcp:127.0.0.1,1433;database=master;user id=sa;password=YourStrong!Passw0rd;TrustServerCertificate=true"

Troubleshooting

SymptomFix
Login failed for userVerify username and password in the connection string
Cannot open serverCheck the server hostname, port, and network access
SSL Provider: certificate verify failedAdd TrustServerCertificate=true for self-signed certs, or install the server's CA cert