Connect SQL Server
AI Insights 365 talks to SQL Server natively — on-prem (via the Gateway), Azure SQL Database, or AWS RDS for SQL Server.
Prerequisites
- A SQL user with
SELECTon the tables you want to expose, plusVIEW DEFINITIONfor schema discovery (the safest minimum is membership in thedb_datareaderrole). - For on-prem: an installed and Online AI Insights Gateway.
Connection string format
Server=HOSTNAME[,PORT];Database=YourDb;User Id=USER;Password=PWD;TrustServerCertificate=true
For Azure SQL Database use the fully-qualified server name:
Server=myserver.database.windows.net;Database=YourDb;User Id=USER;Password=PWD;Encrypt=True
Walkthrough
- From a workspace, Add Datasource → SQL Server.
- Enter a Datasource Name.
- If on-prem, toggle Route via Gateway and pick your gateway.
- Paste the connection string.
- Click Test & Load Fields. Tables appear with column counts.
- Pick the tables to expose, then Connect & Finish.
What you'll be able to ask
Once connected, the AI agent reads your schema and can answer:
- "What's the trend of orders by month in 2026?"
- "Top 10 customers by revenue last quarter"
- "Show me products with no sales in the last 30 days"
Every answer ships with the SQL it ran (click Show query) and the rows it touched.