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

# SQL Server

> Import CSV files and Excel sheets directly into your SQL Server tables.

Import CSV files and Excel sheets directly into your SQL Server tables.

<Steps>
  <Step title="Select SQL Server as the destination">
    Select **SQL Server Database** as the destination type.
  </Step>

  <Step title="Connect your database">
    Connect your SQL Server database by providing the credentials.
  </Step>

  <Step title="Set the target table">
    Specify the table name where you want the data to be pushed.
  </Step>

  <Step title="Test the connection">
    Click **Test Connection**.
  </Step>

  <Step title="Map columns">
    If the connection is successful, click **Map Columns** and match the sheet template columns to the SQL Server table columns. You can also map custom attributes to table columns.
  </Step>

  <Step title="Choose the operation">
    Select one of the following 2 operations:

    * **Insert**: the importer always pushes the incoming CSV data as new records in the database.
    * **Upsert**: the importer checks whether the record exists in the database. If it exists, it's updated with the incoming data from the CSV. If it doesn't, a new record is inserted. The record check is based on the index keys specified in the mapping modal.

    <Frame>
      <img src="https://mintcdn.com/csvbox-io/Fn747PbJ5U7GCAW2/images/unique-1.jpg?fit=max&auto=format&n=Fn747PbJ5U7GCAW2&q=85&s=c970661185ffe948a4296a201d679f28" alt="Define unique key for upsert operation" width="500" height="686" data-path="images/unique-1.jpg" />
    </Frame>
  </Step>
</Steps>

<Warning>
  The **Upsert** operation is significantly slower than the **Insert** operation. With **Insert**, records can be pushed in chunks, whereas **Upsert** processes only one record at a time and requires multiple queries.
</Warning>

<Note>
  Boolean columns that use [Display as checkbox](/dashboard-settings/validations#display-as-checkbox) are pushed as `true` or `false`, which SQL Server accepts for boolean columns.
</Note>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.