MSSQL Connection

The MSSQL connection type enables connection to Microsoft SQL Server.

Default Connection IDs

MSSQL Hook uses parameter mssql_conn_id for the connection ID. The default value is mssql_default.

Configuring the Connection

Host (required)

The host to connect to.

Schema (optional)

Specify the schema name to be used in the database.

Login (required)

Specify the user name to connect.

Password (required)

Specify the password to connect.

Port (required)

The port to connect.

Extra (optional)

Specify the extra parameters (as json dictionary) that can be used in MSSQL connection.

More details on all MSSQL parameters supported can be found in MSSQL documentation.

When specifying the connection as URI (in AIRFLOW_CONN_{CONN_ID} variable) you should specify it following the standard syntax of DB connections - where extras are passed as parameters of the URI. Note that all components of the URI should be URL-encoded.

For example:

export AIRFLOW_CONN_MSSQL_DEFAULT='mssql://username:password@server.com:1433/database_name'

If serializing with JSON:

export AIRFLOW_CONN_MSSQL_DEFAULT='{
    "conn_type": "mssql",
    "login": "username",
    "password": "password",
    "host": "server.com",
    "port": 1433,
    "schema": "database_name"
}'

Was this entry helpful?