MsSqlOperator

MSSQL

Executes sql code in a specific Microsoft SQL database

View on GitHub

Last Updated: May. 7, 2021

Access Instructions

Install the MSSQL provider package into your Airflow environment.

Import the module into your DAG file and instantiate it with your desired params.

Parameters

sqlRequiredstr or string pointing to a template file with .sql extension. (templated)the sql code to be executed
mssql_conn_idstrreference to a specific mssql database
parametersdict or iterable(optional) the parameters to render the SQL query with.
autocommitboolif True, each command is automatically committed. (default value: False)
databasestrname of database which overwrite defined one in connection

Documentation

Executes sql code in a specific Microsoft SQL database

This operator may use one of two hooks, depending on the conn_type of the connection.

If conn_type is 'odbc', then OdbcHook is used. Otherwise, MsSqlHook is used.

Was this page helpful?