> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://apidocs.polytomic.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://apidocs.polytomic.com/_mcp/server.

# Azure SQL

Supports:
* ✅ Models
* ✅ Model sync destination
* ✅ Bulk sync source
* ✅ Bulk sync destination




## Connection

### Configuration
<table>
<thead>
<tr>
<th>Name</th><th>Type</th><th>Description</th><th>Required</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>blobStore</code></td>
<td><code>boolean</code></td>
<td style="vertical-align: top;">Use Azure blob storage for faster bulk loading (destination only) <a href="#blobstore">↓</a></td>
<td><code>false</code></td>
</tr>
<tr>
<td><code>database</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Database</td>
<td><code>true</code></td>
</tr>
<tr>
<td><code>hostname</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Server</td>
<td><code>true</code></td>
</tr>
<tr>
<td><code>password</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Password</td>
<td><code>true</code></td>
</tr>
<tr>
<td><code>port</code></td>
<td><code>integer</code></td>
<td style="vertical-align: top;">Port</td>
<td><code>true</code></td>
</tr>
<tr>
<td><code>ssh</code></td>
<td><code>boolean</code></td>
<td style="vertical-align: top;">Connect over SSH tunnel <a href="#ssh">↓</a></td>
<td><code>false</code></td>
</tr>
<tr>
<td><code>ssl</code></td>
<td><code>boolean</code></td>
<td style="vertical-align: top;">Use SSL</td>
<td><code>false</code></td>
</tr>
<tr>
<td><code>username</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Username</td>
<td><code>true</code></td>
</tr>
</tbody>
</table>

<h4 id="blobstore">`blobStore`</h4>

<h5 id="blobstore-true">When `blobStore` is `true`</h5>

<table>
<thead>
<tr>
<th>Name</th><th>Type</th><th>Description</th><th>Required</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>access_key</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Storage account access key (destination only)</td>
<td><code>true</code></td>
</tr>
<tr>
<td><code>account_name</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Storage account name (destination only)</td>
<td><code>true</code></td>
</tr>
<tr>
<td><code>container_name</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Storage container name (destination only)</td>
<td><code>true</code></td>
</tr>
</tbody>
</table>


<h4 id="ssh">`ssh`</h4>

<h5 id="ssh-true">When `ssh` is `true`</h5>

<table>
<thead>
<tr>
<th>Name</th><th>Type</th><th>Description</th><th>Required</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>ssh_host</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">SSH host</td>
<td><code>true</code></td>
</tr>
<tr>
<td><code>ssh_port</code></td>
<td><code>integer</code></td>
<td style="vertical-align: top;">SSH port</td>
<td><code>true</code></td>
</tr>
<tr>
<td><code>ssh_private_key</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Private key</td>
<td><code>true</code></td>
</tr>
<tr>
<td><code>ssh_user</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">SSH user</td>
<td><code>true</code></td>
</tr>
</tbody>
</table>



#### Example

```json
{
  "name": "Azure SQL connection",
  "type": "azuresql",
  "configuration": {
    "blobStore": false,
    "database": "sampledb",
    "hostname": "example.database.windows.net",
    "password": "secret",
    "port": 1433,
    "ssh": false,
    "ssl": false,
    "username": "user"
  }
}
```

## Model Sync
### Source
#### Configuration
<table>
<thead>
<tr>
<th>Name</th><th>Type</th><th>Description</th><th>Required</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>query</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;"></td>
<td><code>false</code></td>
</tr>
<tr>
<td><code>table</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Table</td>
<td><code>false</code></td>
</tr>
<tr>
<td><code>view</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">View</td>
<td><code>false</code></td>
</tr>
</tbody>
</table>


#### Example
```json
{
  ...
  "configuration": {
    "query": "SELECT * from users",
    "table": "users",
    "view": "active_users"
  }
}
```

### Target
Azure SQL connections may be used as the destination in a model sync.
#### All targets

##### Configuration
<table>
<thead>
<tr>
<th>Name</th><th>Type</th><th>Description</th><th>Required</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>created_column</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">'Created at' timestamp column</td>
<td><code>false</code></td>
</tr>
<tr>
<td><code>preserve_table_on_resync</code></td>
<td><code>boolean</code></td>
<td style="vertical-align: top;">Preserve destination table when resyncing</td>
<td><code>false</code></td>
</tr>
<tr>
<td><code>updated_column</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">'Updated at' timestamp column</td>
<td><code>false</code></td>
</tr>
<tr>
<td><code>write_null_values</code></td>
<td><code>boolean</code></td>
<td style="vertical-align: top;">Copy null values<br/><br/>When enabled updates will set fields to NULL when the source value is null</td>
<td><code>false</code></td>
</tr>
<tr>
<td><code>write_record_timestamps</code></td>
<td><code>boolean</code></td>
<td style="vertical-align: top;">Write row timestamp metadata</td>
<td><code>false</code></td>
</tr>
</tbody>
</table>


##### Example
```json
{
  ...
  "target": {
      "configuration": {
        "created_column": "",
        "preserve_table_on_resync": false,
        "updated_column": "",
        "write_null_values": false,
        "write_record_timestamps": false
    }
  }
}
```





### Target creation

Azure SQL connections may be used to create a new target for a model sync. The
following parameters are required to create a new target:

<table>
<thead>
<tr>
  <th>NAME</th>
  <th>DESCRIPTION</th>
  <th>ENUM</th>
</tr></thead>
<tbody>
<tr>
  <td>name</td>
  <td>Table name</td>
  <td>false</td>
</tr>

</tbody>
</table>




## Bulk Sync
### Source
Azure SQL connections may be used as a bulk sync source. No additional configuration options are required.

### Destination
#### Configuration
<table>
<thead>
<tr>
<th>Name</th><th>Type</th><th>Description</th><th>Required</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>advanced</code></td>
<td><code>object</code></td>
<td style="vertical-align: top;"></td>
<td><code>false</code></td>
</tr>
<tr>
<td><code>mirror_schemas</code></td>
<td><code>boolean</code></td>
<td style="vertical-align: top;">Mirror schemas</td>
<td><code>false</code></td>
</tr>
<tr>
<td><code>schema</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Output schema</td>
<td><code>false</code></td>
</tr>
</tbody>
</table>


#### Example
```json
{
  ...
  "destination_configuration": {
    "advanced": {
        "empty_strings_null": false,
        "hard_deletes": false,
        "initial_execution": "",
        "table_prefix": "",
        "truncate_existing": false
    },
    "mirror_schemas": false,
    "schema": "schema"
  }
}
```



## Type handling
### Destination types
|       POLYTOMIC TYPE        |       AZURE SQL TYPE       |
|-----------------------------|----------------------------|
| `array<>`                   | `NVARCHAR(MAX)`            |
| `bigint`                    | `BIGINT`                   |
| `boolean`                   | `BIT`                      |
| `date`                      | `DATE`                     |
| `datetime`                  | `DATETIMEOFFSET`           |
| `decimal(precision, scale)` | `DECIMAL(precision,scale)` |
| `double`                    | `FLOAT`                    |
| `int`                       | `INT`                      |
| `json`                      | `NVARCHAR(MAX)`            |
| `jsonarray`                 | `NVARCHAR(MAX)`            |
| `number`                    | `NUMERIC(38,10)`           |
| `object{}`                  | `NVARCHAR(MAX)`            |
| `single`                    | `REAL`                     |
| `smallint`                  | `SMALLINT`                 |
| `string`                    | `NVARCHAR(4000)`           |
| `time`                      | `TIME`                     |


### Source types
|       AZURE SQL TYPE        |       POLYTOMIC TYPE        |
|-----------------------------|-----------------------------|
| `BIGINT`                    | `bigint`                    |
| `CHAR`                      | `string`                    |
| `DATE`                      | `date`                      |
| `DATETIME`                  | `datetime`                  |
| `DATETIME2`                 | `datetime`                  |
| `DATETIMEOFFSET`            | `datetime`                  |
| `DECIMAL`                   | `number`                    |
| `DECIMAL(precision, scale)` | `decimal(precision, scale)` |
| `FLOAT`                     | `double`                    |
| `INT`                       | `int`                       |
| `MONEY`                     | `decimal(precision, scale)` |
| `NCHAR`                     | `string`                    |
| `NTEXT`                     | `string`                    |
| `NUMBER(precision, scale)`  | `decimal(precision, scale)` |
| `NUMERIC`                   | `number`                    |
| `NUMERIC(precision, scale)` | `decimal(precision, scale)` |
| `NVARCHAR`                  | `string`                    |
| `REAL`                      | `single`                    |
| `SMALLDATETIME`             | `datetime`                  |
| `SMALLINT`                  | `smallint`                  |
| `SMALLMONEY`                | `decimal(precision, scale)` |
| `TEXT`                      | `string`                    |
| `TIME`                      | `time`                      |
| `TINYINT`                   | `smallint`                  |
| `UNIQUEIDENTIFIER`          | `string`                    |
| `VARCHAR`                   | `string`                    |
| `XML`                       | `string`                    |