---
title: "Microsoft SQL Server Integration"
description: "Connect AI agents to Microsoft SQL Server and Azure SQL Database. Agents run parameterized T-SQL, do CRUD without SQL, inspect schemas, and bulk-load rows as steps in a flow."
url: https://flowrunner.ai/integrations/sql-server
date_modified: 2026-08-01T02:40:32-07:00
---

# Microsoft SQL Server

[Database](https://flowrunner.ai/integrations/category/databases-warehouses)

Connect AI agents to Microsoft SQL Server and Azure SQL Database. Agents run parameterized T-SQL, do CRUD without SQL, inspect schemas, and bulk-load rows as steps in a flow.

[Verified](https://flowrunner.ai/integrations/verified "What does verified mean?") · 9 actions · Basic auth · available

[Microsoft SQL Server website](https://microsoft.com/) · [Platform Documentation](https://learn.microsoft.com/en-us/sql/) · Capability data verified 2026-08-12

1.  A flow needs to record the outcome of an upstream process in SQL Server
2.  Agent runs Select Rows to read the current record with TOP or OFFSET/FETCH paging
3.  Agent confirms the record is in the expected state before changing it
4.  Agent flags any record whose state does not match the incoming change
5.  Agent runs Upsert Row (MERGE) to write the outcome idempotently
6.  The process owner receives a status summary via Slack
7.  Any write to a production table above a row threshold pauses for approval

## What This Integration Enables

Agents run parameterized T-SQL, do CRUD without SQL, inspect structure with Get Table Schema and List Tables, and bulk-load rows fetched from other services. Insert Row and Insert Rows return the written rows via `OUTPUT INSERTED.*`, and Upsert Row uses a `MERGE` keyed on the columns you name. The connect-per-call model gives each operation a dedicated single connection that opens and closes cleanly, so no connection is cached or leaked between runs.

### Without FlowRunner

**Reports over the shoulder**: Ops asks a DBA to run a query whenever they need current data

**Missing WHERE risk**: An UPDATE or DELETE without a WHERE rewrites the whole table

**Fragile scheduled jobs**: SQL Agent jobs and scripts drift out of sync with the process they serve

### With FlowRunner

**Self-serve governed reads**: Agents read current data as a flow step without a DBA in the loop

**Writes require a Where**: Update Rows and Delete Rows refuse to run without an explicit filter

**MERGE keeps it idempotent**: Upsert Row writes each record exactly once across re-runs

## Use Case Scenarios

### DBA-free operational reads

An operations manager needs current figures that used to require a DBA to run a query. The agent calls Select Rows against the reporting table and returns the numbers to the flow, which formats them for the channel where the team works. The DBA stops fielding one-off requests, and the data stays governed.

### Idempotent outcome recording

An upstream process finishes and the flow needs to record its result. The agent calls Upsert Row, which runs a `MERGE ... WHEN MATCHED THEN UPDATE WHEN NOT MATCHED THEN INSERT` keyed on the record's key columns. Re-running the flow updates the existing row rather than inserting a duplicate.

### Correction write with a human gate

The agent detects a set of records that need a corrective update. Before it writes to a production table above the configured threshold, it does not act on its own. It routes the proposed Update Rows for approval and applies it only after a person confirms.

## Human-in-Loop Highlight

A bulk write against a production SQL Server table is easy to run and hard to walk back, especially when downstream reports depend on it. FlowRunner's answer is human-in-the-loop, an execution pattern where the agent pauses on its own, assembles the context and the choices, routes to a human on their preferred channel, and resumes the moment they respond. When an Update Rows or Delete Rows would affect more rows than the configured threshold, or would write to a table flagged as production, the agent pauses before executing and asks through Slack: "This Update Rows on `dbo.Invoices` matches 903 rows. Here is the Where object and a sample. Approve, edit the filter, or cancel?" The write runs only after a person confirms, with the approver and timestamp captured in the run log. A connector can run any T-SQL; an orchestration layer knows which statements should stop and ask.

Agent processes routinely

Detects exception requiring judgment

Clear match Continues automatically

Ambiguous Routes to human via Slack

Human decides

Agent resumes with decision

## Agent Capabilities

9 actions

### SQL

1

-   **Execute Query** Runs any T-SQL statement (SELECT, INSERT, UPDATE, DELETE, DDL, CTEs, EXEC) with \`@p1, @p2\` placeholders bound via the Parameters array, and returns the recordset and affected row counts. Use it for stored procedure calls and the intentional cases the row helpers do not cover.

### Rows

6

-   **Select Rows** Reads rows without writing SQL, with column selection, equality filters, ordering, and limit and offset via \`TOP\` and \`OFFSET ... FETCH\`.
-   **Insert Row** Inserts one row from a JSON object and returns the inserted row via \`OUTPUT INSERTED.\*\`.
-   **Insert Rows** Bulk-inserts an array of row objects in a single statement.
-   **Update Rows** Updates rows matching a non-empty Where object and returns the updated rows. A Where object is required to prevent a full-table write.
-   **Delete Rows** Deletes rows matching a non-empty Where object and returns the deleted count. A Where object is required to prevent a full-table delete.
-   **Upsert Row** Runs \`MERGE ... WHEN MATCHED THEN UPDATE WHEN NOT MATCHED THEN INSERT\` keyed by the given key columns, so an agent can write each record exactly once across re-runs.

### Schema

2

-   **Get Table Schema** Returns column names, types, nullability, defaults, and positions from \`INFORMATION\_SCHEMA.COLUMNS\`.
-   **List Tables** Lists all base tables in the database, with views excluded, for schema discovery.

## Frequently Asked Questions

### What can FlowRunner do with Microsoft SQL Server?

FlowRunner agents can run Execute Query, Select Rows, and Insert Row in Microsoft SQL Server, plus 6 more actions.

### Does connecting Microsoft SQL Server to FlowRunner require OAuth?

No. Microsoft SQL Server connects to FlowRunner with basic authentication (a username and password), no OAuth flow required.

### Can Microsoft SQL Server trigger a FlowRunner workflow automatically?

Microsoft SQL Server doesn't currently expose triggers in FlowRunner. It connects as an action step inside workflows started by another trigger.

**Work at Microsoft SQL Server?** This integration exposes Microsoft SQL Server to AI agents on every FlowRunner plan, including through MCP, at no cost to you. [See what FlowRunner offers integration partners](https://flowrunner.ai/integrations/partners), including how to keep this page current.

---
Markdown version of https://flowrunner.ai/integrations/sql-server. Site index: https://flowrunner.ai/llms.txt
