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

# Microsoft SQL Server

## Overview

Stigg's integration with Microsoft SQL Server allows you to export your product catalog, customer, and subscription data directly to your SQL Server database for custom reporting and analysis.

<Note>
  Stigg's native data export integrations are included in the Scale plan, and are also available as an optional add-on to the Growth plan. See Stigg's pricing for more details.
</Note>

<Card title="View the full entity schema" icon="sitemap" href="./schema">
  See every table and column exported to your destination, organized by entity group.
</Card>

## Setting up the integration

### Prerequisites

* Your database must allow TCP/IP connections. This applies to on-premises SQL Server, Azure SQL Database, and Azure Synapse.
* If the database is protected by a security group or firewall, you'll need Stigg's static IP available to complete the first step below: Cloud Hosted (US) `35.192.85.117/32`, Cloud Hosted (EU) `104.199.49.149/32`. For private-cloud or self-hosted deployments, [contact Stigg support](mailto:support@stigg.io) for the static egress IP.

<Steps>
  <Step title="Allow access">
    Create a rule in your security group or firewall settings to whitelist:

    * Incoming connections to your host and port (usually `1433`) from Stigg's static IP.
    * Outgoing connections from ports `1024` to `65535` to Stigg's static IP.

    <Note>
      If your database can't be made reachable via a static IP, you can connect over an SSH tunnel instead. This requires a bastion host that allows inbound SSH from Stigg's static egress IP, with an SSH user configured using Stigg's public key, and access from the bastion host's IP to the database port. [Contact Stigg support](mailto:support@stigg.io) for the public key.
    </Note>
  </Step>

  <Step title="Create a writer user">
    Connect to your database and create a dedicated login and user for Stigg:

    <CodeGroup>
      ```sql Create login and user theme={null}
      USE <database>;
      CREATE LOGIN <username> WITH PASSWORD = '<password>';
      CREATE USER <username> FOR LOGIN <username>;
      ```
    </CodeGroup>

    Grant it permission to create tables in the database:

    <CodeGroup>
      ```sql Grant table creation theme={null}
      GRANT CREATE TABLE TO <username>;
      ```
    </CodeGroup>

    If the target schema doesn't exist yet, also grant permission to create it — it will be created automatically on first sync:

    <CodeGroup>
      ```sql Grant schema creation theme={null}
      GRANT CREATE SCHEMA TO <username>;
      ```
    </CodeGroup>

    If the schema already exists, grant the user access to it directly instead:

    <CodeGroup>
      ```sql Grant schema privileges theme={null}
      GRANT SELECT, INSERT, UPDATE, DELETE, ALTER ON SCHEMA :: <schema> TO <username>;
      ```
    </CodeGroup>

    <Warning>
      Avoid using `@`, `[`, `]`, `/`, `?`, `#`, `"`, `\`, `+`, spaces, `&`, `:`, `;`, `%`, or `=` in the username or password — these characters can break connection string parsing.
    </Warning>
  </Step>

  <Step title="Connect Stigg with SQL Server">
    In [Stigg](https://app.stigg.io/), navigate to **Integrations > Apps > Microsoft SQL Server**.

    Enter the following information in the connection form:

    | Field    | Description                                            |
    | -------- | ------------------------------------------------------ |
    | Host     | The hostname or IP address of your SQL Server instance |
    | Port     | The port SQL Server listens on. Defaults to `1433`.    |
    | Database | The name of the target database                        |
    | Schema   | The schema where Stigg will create and sync tables     |
    | Username | The SQL Server user Stigg will authenticate as         |
    | Password | The password for the SQL Server user                   |

    Click **Test & connect**.
  </Step>

  <Step title="Select entities to export">
    After entering your connection details, expand the **Entities to export** section to choose which entity groups to include in the sync. All groups are selected by default.

    See [Exported entities](./overview#exported-entities) for a description of each group.
  </Step>
</Steps>


## Related topics

- [Exported entities](/documentation/importing-and-exporting-data/export/overview.md#exported-entities)
- [Sync process, schedule, manual sync, and sync history](/documentation/importing-and-exporting-data/export/overview.md#sync-process)
