Connect SQL Server through the AI Insights Gateway

· Last updated

Prefer to watch? How to connect a database Narrated video, 1:08

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 SELECT on the tables you want to expose, plus VIEW DEFINITION for schema discovery (the safest minimum is membership in the db_datareader role).
  • 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

  1. From a workspace, Add Datasource → SQL Server.
  2. Enter a Datasource Name.
  3. If on-prem, toggle Route via Gateway and pick your gateway.
  4. Paste the connection string.
  5. Click Test & Load Fields. Tables appear with column counts.
  6. 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.