> For the complete documentation index, see [llms.txt](https://docs.coupler.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coupler.io/destinations/categories/database/microsoft_sql_server/connection-setup.md). Agents can also search and read this documentation through its [MCP server](https://docs.coupler.io/~gitbook/mcp).

# Microsoft SQL Server Connection Setup

Set up the Microsoft SQL Server connection for Coupler.io: SQL Server authentication, network access, a login with permissions, and encryption.

Coupler.io connects to SQL Server with **SQL Server authentication** (a login with a user name and password). Follow these steps once per server.

{% hint style="info" %}
For Azure SQL Database, use the [Azure SQL](https://docs.coupler.io/destinations/categories/database/azure_sql/connection-setup.md) destination instead.
{% endhint %}

## Enable SQL Server authentication

SQL Server must accept SQL Server logins, not only Windows logins.

{% stepper %}
{% step %}
**Check the authentication mode.** In SQL Server Management Studio, right-click the server → **Properties** → **Security**. Under **Server authentication**, select **SQL Server and Windows Authentication mode** and click **OK**.
{% endstep %}

{% step %}
**Restart SQL Server.** The new mode applies after the SQL Server service restarts.
{% endstep %}
{% endstepper %}

On Amazon RDS and Google Cloud SQL, SQL Server authentication is always on.

## Allow connections from Coupler.io

Coupler.io connects from these IP addresses:

* `34.123.243.115`
* `34.170.96.92`

{% stepper %}
{% step %}
**Make sure SQL Server listens on TCP.** In **SQL Server Configuration Manager** → **SQL Server Network Configuration** → **Protocols for \<instance>**, enable **TCP/IP**, and note the port (default `1433`). Restart the service if you changed it.
{% endstep %}

{% step %}
**Open the port for the Coupler.io IP addresses.** Allow inbound TCP connections on the SQL Server port from both addresses in every firewall on the way: Windows Firewall on the server, your network firewall or router, and the cloud security group (for example, the security group of an Amazon RDS instance, or the authorized networks of a Google Cloud SQL instance).
{% endstep %}
{% endstepper %}

{% hint style="warning" %}
The server must be reachable from the internet. SSH tunnels, VPNs and private networks aren't supported.
{% endhint %}

## Create a login and database user

Connect to the server as an administrator and run, replacing the database name and password:

```sql
-- Server login
USE master;
CREATE LOGIN coupler_user WITH PASSWORD = '<strong password>';

-- User in the target database
USE <database>;
CREATE USER coupler_user FOR LOGIN coupler_user;

-- Create and replace tables in the <schema> schema, and load rows
GRANT CREATE TABLE TO coupler_user;
GRANT ALTER, INSERT ON SCHEMA::<schema> TO coupler_user;

-- Optional: let Coupler.io create new schemas
GRANT CREATE SCHEMA TO coupler_user;
```

What each permission is for:

| What Coupler.io does                             | When                                  | Permission                                |
| ------------------------------------------------ | ------------------------------------- | ----------------------------------------- |
| Loads rows                                       | Every run                             | `INSERT` on the table or schema           |
| Creates the table, or drops and creates it again | Replace mode; Append into a new table | `CREATE TABLE`, and `ALTER` on the schema |
| Creates a new schema                             | Only if the schema doesn't exist      | `CREATE SCHEMA`                           |

For **Append** into a \<table> that already existsin \<schema>, `INSERT` on that table is enough:

```sql
GRANT INSERT ON OBJECT::<schema>.<table> TO coupler_user;
```

{% hint style="warning" %}
A schema belongs to the user who created it. If another user created the schema or the table, grant `ALTER` on that schema to the Coupler.io user, or Replace mode fails with "Cannot drop the table".
{% endhint %}

## Connect in Coupler.io

In the Microsoft SQL Server connection form, fill in:

* **Host** — host name, IPv4 or IPv6 address of the server
* **Port** — `1433`, or the port SQL Server listens on
* **Database** — the target database name
* **User** — `coupler_user`
* **Password** — the login's password
* **Encrypt**, **Host name in certificate**, **Validate server certificate** — see [Connection encryption](#connection-encryption)

Click **Save**. The details are checked on the first run.

## Connection encryption

| Setting                         | Options                                                                                                                                                                                 | Default |
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| **Encrypt**                     | **Strict** — TDS 8.0; the connection is always encrypted and the server certificate is always validated. Needs SQL Server 2022 or later.                                                |         |
|                                 | **Mandatory** — the connection is always encrypted; the server certificate is validated unless **Validate server certificate** is **No**.                                               | Default |
|                                 | **Optional** — the connection is encrypted only if the server requires it.                                                                                                              |         |
| **Host name in certificate**    | The name to check in the server certificate. Leave it empty to use the **Host**. Set it when you connect by IP address or by a different name than the one in the certificate.          | Empty   |
| **Validate server certificate** | **Yes** — the certificate must be issued by a trusted certificate authority, be valid, and match the host name. **No** — the certificate isn't checked. Always **Yes** with **Strict**. | Yes     |

Which to choose:

* **A server with a certificate from a trusted certificate authority** — keep **Mandatory** and **Yes**, or use **Strict** on SQL Server 2022 or later.
* **A server with a self-signed certificate on a trusted network** — **Mandatory** and **Validate server certificate: No**.
* **A server without encryption configured** — **Optional**. The data then travels unencrypted unless the server forces encryption, so use this only on a trusted network.

## Check the connection

Run the data flow once. If it fails, the error in **Flow settings** → **History** tells you what to fix — see [Microsoft SQL Server common issues](https://docs.coupler.io/destinations/categories/database/microsoft_sql_server.md#microsoft-sql-server-common-issues).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.coupler.io/destinations/categories/database/microsoft_sql_server/connection-setup.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
