Microsoft SQL Server remains massively used in Microsoft-centric organizations. Connecting Apache Superset to SQL Server (on-premise or Azure SQL) is straightforward with the right driver. This tutorial details the procedure for 2026.
1. Prerequisites
- An accessible Superset instance;
- A SQL Server 2017+ or Azure SQL Database reachable;
- A read-only account;
- The
pymssqlorpyodbcdriver installed.
If you want to start quickly, TVL Managed Superset includes SQL Server drivers by default.
2. Create a read-only account
-- On SQL Server
CREATE LOGIN superset_reader WITH PASSWORD = 'XXX';
USE prod;
CREATE USER superset_reader FOR LOGIN superset_reader;
ALTER ROLE db_datareader ADD MEMBER superset_reader;
3. Driver and URI
With pymssql (recommended)
uv pip install pymssql
# URI
mssql+pymssql://<user>:<password>@<host>:1433/<database>
With pyodbc (Azure SQL)
uv pip install pyodbc
# Azure SQL URI
mssql+pyodbc://<user>:<password>@<server>.database.windows.net:1433/<db>?driver=ODBC+Driver+18+for+SQL+Server
4. Add to Superset
- UI → Settings → Database Connections → + Database;
- Type: Microsoft SQL Server;
- Paste the URI;
- Test → Save.
5. Azure AD authentication
For Azure SQL with Azure AD auth:
mssql+pyodbc://@<server>.database.windows.net/<db>?driver=ODBC+Driver+18+for+SQL+Server&authentication=ActiveDirectoryMsi
Or with service principal:
mssql+pyodbc://<client_id>:<client_secret>@<server>.database.windows.net/<db>?driver=ODBC+Driver+18+for+SQL+Server&authentication=ActiveDirectoryServicePrincipal
This configuration is applied by default on TVL Managed Superset, which follows community best practices.
6. Optimization
- Columnstore index SQL Server for analytical workloads;
- Read-only replica on Azure SQL;
- Aggressive Superset cache on executive dashboards;
- Connection pool sized according to Azure SQL tier.
7. Common pitfalls
- "Login failed": Azure SQL firewall must allow Superset IP (Server → Networking → Firewall rules);
- ODBC Driver missing: install
msodbcsql18in the Superset container; - Encoding: SQL Server 2017+ supports UTF-8 but requires UTF-8 collation;
- Long timeout: adjust
SQLALCHEMY_ENGINE_OPTIONSwithconnect_timeout=30.
8. Conclusion
Microsoft SQL Server + Apache Superset is a solid combo for Microsoft organizations. For Azure SQL, Azure AD authentication brings a higher level of security. For purely analytical loads, consider Azure Synapse or regular export to BigQuery / Snowflake.
Want the benefits of Apache Superset without the friction of installation and maintenance? Deploy your instance in 3 clicks with TVL Managed Superset, hosted in Europe (OVHcloud, Roubaix, France).
For more: connect PostgreSQL, SSO Azure AD, vs Power BI.