> For the complete documentation index, see [llms.txt](https://docs.tonic.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tonic.ai/fabricate/data-masking/masking-db-reqs/sql-server.md).

# SQL Server

## Server and schema requirements

For SQL Server, Fabricate masking has the following server and schema requirements:

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top"><strong>Version</strong></td><td valign="top">The source and destination databases must use SQL Server 2017 or later.</td></tr><tr><td valign="top"><strong>Collation</strong></td><td valign="top"><p>The collation must be the same on both the source and destination databases.</p><p></p><p>The source database collation must match the server collation.</p></td></tr></tbody></table>

The databases cannot use the following types and features:

* `sql_variant`, `hierarchyid`, `geography`, `geometry` and Common Language Runtime (CLR) user-defined types
* Memory-optimized, ledger and graph tables
* Always Encrypted columns
* Sparse columns and column sets
* FileTables

On both the source and destination databases, set `QUERY_GOVERNOR_COST_LIMIT = 0`.

## Connection and infrastructure requirements

For the source and destination database connections:

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top"><strong>Direct TCP with an explicit port</strong></td><td valign="top"><p>Do not use:</p><p></p><ul><li>Named instances resolved through SQL Server Browser.</li><li>Any proxy that multiplexes TDS sessions.</li></ul></td></tr><tr><td valign="top"><strong>Authentication</strong></td><td valign="top"><p>Use either:</p><p></p><ul><li>SQL Server authentication</li><li>A Microsoft Entra service principal</li></ul><p>You cannot use Windows or Kerberos authentication.</p></td></tr><tr><td valign="top"><strong>TLS</strong></td><td valign="top"><p>Use TLS 1.2 or later, with a certificate that is issued by a certificate authority that the Fabricate server trusts.</p><p></p><p>You cannot use a self-signed certificate.</p></td></tr><tr><td valign="top"><strong>Fabricate memory</strong></td><td valign="top"><p>For a self-hosted instance, ensure that the memory on the Fabricate server is larger than the size of the largest source table.</p><p></p><p>Each table is held in memory before it is written to the destination database.</p></td></tr></tbody></table>

## Source database requirements

### Source database user requirements

The source database user must have db\_datareader and UNMASK.

The source database cannot have a row-level security policy that filters the database user.

### Direct connection

The connection to the source database must be a direct connection to the primary replica. You cannot use read-only routing.

## Destination database requirements

### Destination database user requirements

The destination database user must be a db\_owner.

### Triggers

The destination database tables cannot have DML triggers.

### Recovery model and transaction log

The destination database must use the SIMPLE recovery model.

It must also have a transaction log that is sized for the largest table.

### Create the destination schema before masking

For SQL Server, Fabricate cannot automatically create the destination database schema.

Before you run the masking, create the destination database schema. The schema must be identical to the source database schema.


---

# 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.tonic.ai/fabricate/data-masking/masking-db-reqs/sql-server.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.
