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

# ETL: SQL Server Snapshot CDC Source

> How to configure the SQL Server Snapshot CDC source component to read changed records from SQL Server in your Integrate.io ETL pipeline.

Use the SQL Server (Snapshot CDC) source component to read only the records that have changed in your SQL Server tables since the previous pipeline run, instead of reprocessing the entire table every time. The component produces two outputs: **Upserted records** (new and updated rows) and **Deleted records** (rows removed from the source).

## Connection Setup

Before reading changes, set up your SQL Server connection. See [Connecting to SQL Server](/etl/allowing-integrateio-etl-access-to-microsoft-sql-server-databases) for the credentials and network access required. Once the connection exists, add the **SQL Server (Snapshot CDC)** source component to your pipeline and select it.

## Snapshot Storage

SQL Server is the only connection type that supports both snapshot storage methods:

* **Database**: the snapshot is stored as a table in your SQL Server database, and change detection runs entirely in SQL. Requires write access (`CREATE TABLE`, `INSERT`, and `DELETE`) on the source database. This is the most efficient option when you have write access.
* **File Based**: the snapshot is stored as a Parquet file on Integrate.io managed cloud storage. Use this when your database user has read-only access, or when you do not want additional tables created in the source database.

When you use Database storage, a snapshot table is created automatically in the same schema as the source table and updated after each successful run. Do not modify or delete it manually.

## Change Detection

Choose how the component decides whether a row has changed:

* **Primary Key**: matches rows by a unique identifier column (for example `id` or `order_id`) and detects updates by comparing the remaining column values. Best when the table has a reliable key.
* **Composite Hash**: builds a hash from all or selected columns and compares hashes between runs. Best when the table has no reliable primary key.

Query mode (a custom SQL query instead of a single table) is available only with File Based storage. With Database storage, use Table mode with a Where clause to filter rows.

## Example

Track new and updated orders to sync with a data warehouse:

* **Source table**: `orders`
* **Method**: Primary Key
* **Primary key**: `order_id`
* **Snapshot Storage**: Database
* **Upserted records**: send to the data warehouse for processing
* **Deleted records**: mark as cancelled in the warehouse

## Full Configuration Reference

<Card title="Snapshot CDC Source reference" icon="book" href="/etl/using-components-cdc-database-source" horizontal>
  Configuration steps, change detection methods, query mode, best practices, troubleshooting, and limitations that apply to every Snapshot CDC source.
</Card>
