# Microsoft SQL Server — Pipedream Connect

> Unleash the power of your data—on-premises, in the cloud, or at the edge—and reveal insights to transform your business.

- API slug: `microsoft_sql_server` (use in MCP headers and tool keys)
- Auth: API key (Pipedream-managed)
- Categories: Databases
- Website: https://www.microsoft.com/en-us/sql-server?rtc=1
- This page (HTML): https://pipedream.com/apps/microsoft-sql-server
- Tools: 5 actions · 2 triggers

## Connect via MCP (recommended)

- Endpoint: `https://remote.mcp.pipedream.net/v3`
- Headers: `Authorization: Bearer <token>` · `x-pd-project-id` · `x-pd-environment` · `x-pd-external-user-id` · `x-pd-app-slug: microsoft_sql_server`

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "microsoft_sql_server",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// e.g. run Execute Query:
const result = await mcp.callTool({
  name: "microsoft_sql_server-execute-query",
  arguments: {
    query: "Query",
    inputs: "Inputs",
  },
})
```

Docs: [MCP guide](https://pipedream.com/docs/connect/mcp/developers.md)

## SDK

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "microsoft_sql_server-execute-query",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    microsoft_sql_server: { authProvisionId: "apn_xxxxxxx" },
    query: "Query",
    inputs: "Inputs",
  },
})
```

Docs: [Managed auth guide](https://pipedream.com/docs/connect/managed-auth/quickstart.md) · [Tools guide](https://pipedream.com/docs/connect/components.md)

## Actions (5)

### `microsoft_sql_server-execute-query` — Execute Query (Write)

Executes a SQL query and returns the results. See the documentation

Full schema: https://pipedream.com/apps/microsoft-sql-server/actions/execute-query.md

### `microsoft_sql_server-execute-raw-query` — Execute SQL Query (Write)

Execute a custom SQL query. See our docs to learn more about working with SQL in Pipedream.

Full schema: https://pipedream.com/apps/microsoft-sql-server/actions/execute-raw-query.md

### `microsoft_sql_server-insert-row` — Insert Row (Write)

Inserts a new row in a table. See the documentation

Full schema: https://pipedream.com/apps/microsoft-sql-server/actions/insert-row.md

### `microsoft_sql_server-list-table-options` — List Table Options (Read-only)

Retrieves available options for the Table field.

Full schema: https://pipedream.com/apps/microsoft-sql-server/actions/list-table-options.md

### `database-query-sql-database` — Query SQL Database (Write)

Execute a SQL Query. See our docs to learn more about working with SQL in Pipedream.

Full schema: https://pipedream.com/apps/microsoft-sql-server/actions/database-query-sql-database.md

## Triggers (2)

### `microsoft_sql_server-new-column` — New Column (Polling)

Triggers when a new column is added to a table. See the documentation

Full schema: https://pipedream.com/apps/microsoft-sql-server/triggers/new-column.md

### `microsoft_sql_server-new-or-updated-row` — New Or Updated Row (Polling)

Triggers when a new row is added or an existing row is updated. See the documentation

Full schema: https://pipedream.com/apps/microsoft-sql-server/triggers/new-or-updated-row.md

---

- All apps: https://pipedream.com/apps — index: https://pipedream.com/llms.txt
- Pipedream docs for agents: https://pipedream.com/docs/llms.txt
