> ## Documentation Index
> Fetch the complete documentation index at: https://docs.myrmex.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Microsoft SQL Server

> Connect a Microsoft SQL Server database to Myrmex — create a read-only audit login and add the integration.

import { Note, Steps, Step, CardGroup, Card, Tip } from '@mintlify/components';

Connect your **Microsoft SQL Server** database so Myrmex can audit its hardening and compliance, check its operational health, explore its schema, and — with approval — run T-SQL for you. Myrmex reaches the database over TDS through a [Collector](/documentation/agent-endpoint-security/collector-mode) on your network. Operations run live and on demand through the [Integration Specialist](/documentation/multi-agent-system/integration-specialist-agent) agent — Myrmex reads only what you ask for and keeps none of your data on the Myrmex side.

## What Myrmex Can Do

<CardGroup cols={2}>
  <Card title="Compliance audit" icon="shield-halved">
    Run a [Security Posture](/documentation/security-posture/overview) audit and map findings to CIS, ISO 27001, NIST CSF, and BACEN [frameworks](/documentation/security-posture/frameworks).
  </Card>

  <Card title="Health checks" icon="heart-pulse">
    Review sessions, wait statistics, backups, and Always On availability.
  </Card>

  <Card title="Explore tables" icon="table">
    List databases and tables so you can see what the server holds.
  </Card>

  <Card title="Describe structure" icon="sitemap">
    Inspect columns, types, indexes, and constraints for any table.
  </Card>

  <Card title="Sensitive-data scan" icon="user-secret">
    Scan tables and columns for personal or sensitive data that needs protection.
  </Card>

  <Card title="Run T-SQL" icon="terminal">
    Execute read queries any time; write statements (DDL/DML) require your confirmation.
  </Card>
</CardGroup>

## Before You Start

* A **Collector** on a network that can reach the SQL Server host on its TCP port (default `1433`). See [Collector mode](/documentation/agent-endpoint-security/collector-mode).
* A **dedicated SQL login** for Myrmex (create it in Step 1). This connector uses **SQL authentication** — Windows, Kerberos, and Microsoft Entra ID sign-in are not yet supported.
* **TLS** is recommended. Set SSL Mode to `require` to encrypt the connection (it works with the self-signed certificate SQL Server generates).

## Step 1 — Create the Credential in SQL Server

Create a dedicated, least-privilege login for auditing. The server-level `VIEW` permissions give read access to the dynamic management views and metadata the audit relies on.

```sql theme={null}
-- In the master database, as an administrator (e.g. sa)
CREATE LOGIN myrmex_audit WITH PASSWORD = 'A-Strong-Password1!';
GRANT VIEW SERVER STATE TO myrmex_audit;
GRANT VIEW ANY DEFINITION TO myrmex_audit;
GRANT VIEW ANY DATABASE TO myrmex_audit;
```

<Tip>
  Keep the login read-only for auditing. Grant a write-capable login only if you want the agents to run write statements (DDL/DML) through **Run T-SQL**.
</Tip>

## Step 2 — Add the Integration in Myrmex

From the **Directory**, choose **Add Integration → Microsoft SQL Server**, then fill in:

| Field           | Description                                                                                                                            |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| **Name**        | A unique name for this database.                                                                                                       |
| **Description** | Optional note to identify the instance.                                                                                                |
| **Host**        | SQL Server host or IP (for a named instance, use the host plus the instance's port).                                                   |
| **Port**        | TCP port (default `1433`).                                                                                                             |
| **Database**    | Database to connect to (default `master`).                                                                                             |
| **Username**    | SQL login (read-only for audit) or a write-capable login for operations.                                                               |
| **Password**    | Password (stored encrypted).                                                                                                           |
| **SSL Mode**    | TLS posture: `require` encrypts (trusts the server's self-signed cert), `verify-full` / `verify-ca` validate it, `disable` for no TLS. |
| **Collectors**  | The [Collector(s)](/documentation/agent-endpoint-security/collector-mode) that can reach this database.                                |

## Connect

Click **Connect** to validate the login and TLS settings. The database then appears under **Environment → Integrations** alongside your other [integrations](/documentation/integrations/overview), and you can start asking the AI about it in the Workspace.

## Notes

* **Read-only by default.** Auditing, health, schema exploration, and sensitive-data scans only need the read-only login. Provide a write-capable login only if you want confirmation-gated **Run T-SQL** writes.
* **Nothing is stored.** Every operation runs in real time through the Collector; results return to your Workspace and no database data is retained on the Myrmex side.
* **Authentication.** Use SQL authentication; Windows/Kerberos/Entra ID sign-in is not supported in this release.
