Overview

Use Microsoft SQL Server (MSSQL) as a destination in Mage to export data from your pipelines into relational tables for analytics, reporting, or operational workloads. Mage supports both on-premise SQL Server deployments and cloud-hosted options like Azure SQL Database.


Configuration Parameters

You must provide the following credentials to configure the MSSQL destination:

KeyDescriptionExample ValueRequired
databaseName of the target database where data will be written.msdb
hostHostname or IP address of your MSSQL server.172.20.0.2
portPort used by the MSSQL service. Typically 1433.1433
usernameUsername with permission to read and write to the specified schema and table.guest
passwordPassword for the MSSQL user.abc123...
schemaTarget schema inside the database.public
tableName of the destination table Mage will create or write to.users

Optional Parameters

KeyDescriptionExample Value
authenticationAuthentication method. Set to ActiveDirectoryServicePrincipal to use Azure AD authentication.ActiveDirectoryServicePrincipal
driverName of the ODBC driver for SQL Server.ODBC Driver 18 for SQL Server
skip_schema_creationIf true, Mage will skip the CREATE SCHEMA command during initialization. See GitHub issuetrue
lower_caseIf true, all column names will be converted to lowercase. Default is true.true

Notes

  • Mage uses the SQLAlchemy MSSQL dialect to connect and write data into Microsoft SQL Server.
  • Ensure the user has INSERT and CREATE TABLE permissions if writing to new tables.
  • Azure-hosted SQL Servers may require SSL or Azure AD authentication depending on your network configuration.
  • Make sure any required firewall rules or virtual network settings are properly configured for external access.