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

# Microsoft SQL Server Writeback Connector

## Intro

Microsoft SQL Server is a relational database management system developed by Microsoft. Use this connector to export your data from a Domo DataSet to a Microsoft SQL Server database. For more information about the Microsoft SQL Server API, visit their website. ([https://technet.microsoft.com/en-us/library/aa174556(v=sql.80).aspx](https://technet.microsoft.com/en-us/library/aa174556\(v=sql.80\).aspx)).

You export data to a MS SQL database in the Data Center. This topic discusses the fields and menus that are specific to the MS SQL Database Writeback connector user interface. General information for adding DataSets, setting update schedules, and editing DataSet information is discussed in [Adding a DataSet Using a Data Connector](/docs/s/article/360042926274).

<Note>**Note:** The owner of a writeback dataset must also be an owner or co-owner of the input dataset.</Note>

## Prerequisites

<Warning>**Important:** If access to your MS SQL database or your MS SQL server is restricted by IP address, you may need to whitelist Domo's IP addresses before you can successfully connect and a configure a dataset in Domo. Check with your MS SQL database system administrator to determine if this is the case. To get a list of Domo's IP addresses to whitelist on your MS SQL database or server, see [Whitelisting IP Addresses for Connectors and Federated Adapters](/docs/s/article/360043630093).</Warning>

To configure this connector, you will need the following:

* A Domo Client ID and Client Secret. Learn how to get your [Domo Client ID and Secret](/docs/s/article/000005240#create-api-clients).
* Your MS SQL database or schema name.
* The hostname or IP address of your MS SQL database server, such as db.mycompany.com.
* Your MS SQL Databaseserver port number.
* Your MS SQL username and password.
* The port number for your MS SQL server.

You can also include the URL for an MS SQL CA certificate, though this is optional.

## Configuring the Connection

This section enumerates the options in the **Credentials** and **Details** panes in the MS SQL Writeback Connector page. The components of the other panes in this page, **Scheduling** and **Name & Describe Your DataSet**, are universal across most connector types and are discussed in greater length in [Adding a DataSet Using a Data Connector](/docs/s/article/360042926274).

### Credentials Pane

This pane contains fields for entering credentials to connect to your Domo developer account as well as the table in your MS SQL database where you want your data to be copied to. The following table describes what is needed for each field:

<table border="1" cellpadding="1" cellspacing="1">
  <thead>
    <tr>
      <th colspan="1" rowspan="1"><p>Field</p></th>
      <th colspan="1" rowspan="1"><p>Description</p></th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td colspan="1" rowspan="1"><p>Domo Client ID</p></td>
      <td colspan="1" rowspan="1"><p>Enter your Domo client ID.</p></td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1"><p>Domo Client Secret</p></td>
      <td colspan="1" rowspan="1"><p>Enter your Domo client secret.</p></td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1"><p>Username</p></td>
      <td colspan="1" rowspan="1"><p>Enter your MS SQL username.</p></td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1"><p>Password</p></td>
      <td colspan="1" rowspan="1"><p>Enter your MS SQL password.</p></td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1"><p>Host</p></td>
      <td colspan="1" rowspan="1"><p>Enter your MS SQL database hostname.</p></td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1"><p>Port</p></td>
      <td colspan="1" rowspan="1"><p>Enter your MS SQL database port number.</p></td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1"><p>Database</p></td>
      <td colspan="1" rowspan="1"><p>Enter the name of your MS SQL database.</p></td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1"><p>Certificate</p></td>
      <td colspan="1" rowspan="1"><p>Paste the text for your MS SQL SSL CA certificate.</p></td>
    </tr>
  </tbody>
</table>

For more information about obtaining these credentials, see "Prerequisites," above.

Once you have entered valid credentials, you can use the same account any time you go to set up a new Domo-MS SQL connection. You can manage connector accounts in the **Accounts** tab in the Data Center. For more information about this tab, see [Managing User Accounts for Connectors](/docs/s/article/360042926054).

### Details Pane

This pane contains a number of fields for specifying your data and indicating where it's going.

<table border="1" cellpadding="1" cellspacing="1">
  <thead>
    <tr>
      <th colspan="1" rowspan="1"><p>Menu</p></th>
      <th colspan="1" rowspan="1"><p>Description</p></th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td colspan="1" rowspan="1"><p>Input DataSet ID</p></td>
      <td colspan="1" rowspan="1"><p>Enter the DataSet ID (GUID) for the DataSet you want to copy to MS SQL. You can find the ID by opening the details view for the DataSet in the Data Center and looking at the portion of the URL following datasources/. For example, in the URL [https://mycompany.domo.com/datasources/845305d8-da3d-4107-a9d6-13ef3f86d4a4/details/overview](https://mycompany.domo.com/datasources/845305d8-da3d-4107-a9d6-13ef3f86d4a4/details/overview), the DataSet ID is 845305d8-da3d-4107-a9d6-13ef3f86d4a4.</p></td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1"><p>My input DataSet is large</p></td>
      <td colspan="1" rowspan="1"><p>Select this checkbox to export a large dataset from Domo to Microsoft SQL Server.</p></td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1"><p>Schema Name</p></td>
      <td colspan="1" rowspan="1"><p>Specify the schema to use when creating the table.</p></td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1"><p>Table Name Source</p></td>
      <td colspan="1" rowspan="1"><p>Select how you want to name the table where data will be copied.   - <b>DataSet ID</b>. The table name will be the number you entered for <b> DataSet ID</b>. - <b> DataSet Name</b>. The table name will be the same as that of the input DataSet. - <b> Custom Name</b>. You will give the table a custom name in the <b> Custom Table Name</b> field.</p></td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1"><p>Custom Table Name</p></td>
      <td colspan="1" rowspan="1"><p>Enter the name of the table in your MS SQL database where you want your DataSet data to be copied.</p></td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1"><p>Operation Type</p></td>
      <td colspan="1" rowspan="1"><p>Select the operation you want to perform: </p><table class="zebra-striped bordered"><tbody><tr><th>Operation</th><th>Description</th></tr><tr><td>Create a New Table</td><td>Creates a new table. A new table is created for each execution.</td></tr><tr><td>Update an Existing Table</td><td>Updates an existing table if the table name matches a table in Microsoft SQL Server. If no matching table exists, a new table is created on the first run.</td></tr></tbody></table></td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1"><p>Update Type</p></td>
      <td colspan="1" rowspan="1"><p>Select how you want to update the database table:</p></td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1"><p>Insert Using Select Into statements</p></td>
      <td colspan="1" rowspan="1"><p>Select this checkbox if you want to upload your data using <b>Select Into</b> statements.</p></td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1"><p>Merge Keys</p></td>
      <td colspan="1" rowspan="1"><p>Enter the upsert/merge key. By default, sys\_id will be used as an upsert/merge key.</p></td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1"><p>SQL Data Type for Integer Values</p></td>
      <td colspan="1" rowspan="1"><p>The SQL Data Type for Integer Values dropdown lists <b>INT</b> and <b> BIGINT</b>.</p></td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1"><p>SQL Data Type for String Values</p></td>
      <td colspan="1" rowspan="1"><p>The SQL Data Type for String Values dropdown lists <b>VARCHAR</b> and <b> NVARCHAR</b> data types.</p></td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1"><p>String Size</p></td>
      <td colspan="1" rowspan="1"><p>Choose whether to use the maximum size for STRING types (VARCHAR/NVARCHAR) or specify a custom size.</p></td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1"><p>Custom String Size</p></td>
      <td colspan="1" rowspan="1"><p>Enter the size for STRING types (VARCHAR/NVARCHAR)</p></td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1"><p>Fire Triggers</p></td>
      <td colspan="1" rowspan="1"><p>This causes the server to fire the insert triggers for the inserted database rows.</p></td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1"><p>Enable Data Validation</p></td>
      <td colspan="1" rowspan="1"><p>Select the checkbox to enable data type validation and sanitization.   If selected, invalid values (such as text in numeric columns) will be converted to NULL, preventing upload failures and ensuring smoother data quality management.</p></td>
    </tr>

    <tr>
      <td colspan="1" rowspan="1"><p>Batch Size</p></td>
      <td colspan="1" rowspan="1"><p>Specify the number of rows per batch for bulk copy operations. Larger batch sizes can improve performance for large datasets, while smaller batch sizes can reduce memory usage. Leave this field blank to use the SQL Server default batch size.</p></td>
    </tr>
  </tbody>
</table>

### Other Panes

For information about the remaining sections of the connector interface, including how to configure scheduling, retry, and update options, see [Adding a DataSet Using a Data Connector](/docs/s/article/360042926274).
