SQL Server to Snowflake should be an easy change data capture (CDC) story, because SQL Server already does the hard part. Turn CDC on and the SQL Server Agent copies every insert, update and delete from the transaction log into change tables. Yet plenty of pipelines ignore those tables and re-export whole tables every night, or add Kafka just to read them.
The common ways to move SQL Server data into Snowflake:
-
Manual export: the
bcpbulk copy utility or SQL Server Integration Services (SSIS) writes files, thenCOPY INTOloads them. Hours to daily, and full reloads only, so updates and deletes never arrive as changes. - Debezium, Kafka and the Snowflake Kafka connector: changes reach Snowflake within seconds, but you operate Kafka, Kafka Connect, Debezium and a schema registry.
- Managed extract, load, transform (ELT): Fivetran, Estuary or Airbyte Cloud. Nothing to host, but pricing is per row, per GB or per connector, and the rows land as a second copy inside Snowflake.
- The Snowflake Openflow connector for SQL Server: Snowflake's own connector, writing native tables billed in Snowflake credits. A sound pick when Snowflake is the only reader.
The route in this tutorial skips all four. OLake Go is an open source (Apache 2.0) tool that drains the change tables on a schedule and writes Apache Iceberg tables straight into Horizon, the catalog that ships with every Snowflake account. The tables show up in Snowsight as Snowflake-managed tables, and DuckDB or Spark can open the very same files.
I ran every step below on 2026-10-30: SQL Server 2022 Developer in Docker, OLake Go v1.1.0 through OLake UI, and a Snowflake account on AWS ap-south-1 with an X-Small warehouse. Each timing and row count in this post comes from that run.
What the SQL Server to Snowflake pipeline looks like
-
Source: a database called
shopwith two CDC-enabled tables,dbo.customersanddbo.orders. - Pipeline: OLake UI and OLake Go in Docker Compose. The first sync notes the current log sequence number (LSN) and copies each table in parallel chunks; later syncs read the change tables from that LSN.
- Destination: a Snowflake database on Snowflake's own catalog and storage, with no bucket or stage of yours.
You need: Docker, a Snowflake account where you can run setup as ACCOUNTADMIN, a SQL Server edition with CDC (Developer, Standard 2016 SP1 or later, or Enterprise), and about 30 minutes.
Step 1: Turn on CDC in SQL Server
No SQL Server handy? Start one in Docker. The capture job is an Agent job, and a container keeps the Agent off unless you ask for it:
docker run -d --name mssql \
-e ACCEPT_EULA=Y \
-e MSSQL_SA_PASSWORD='<a strong password>' \
-e MSSQL_AGENT_ENABLED=true \
-p 1433:1433 \
mcr.microsoft.com/mssql/server:2022-latest
Create a database named shop with these two tables, then insert some rows. The run used 8 customers and 40 orders, but any data works:
CREATE TABLE dbo.customers (
id INT IDENTITY(1,1) PRIMARY KEY,
name NVARCHAR(100), email NVARCHAR(200), city NVARCHAR(100), tier NVARCHAR(20),
created_at DATETIME2 DEFAULT SYSUTCDATETIME(),
updated_at DATETIME2 DEFAULT SYSUTCDATETIME());
CREATE TABLE dbo.orders (
id INT IDENTITY(1,1) PRIMARY KEY,
customer_id INT REFERENCES dbo.customers(id),
product NVARCHAR(100), amount DECIMAL(10,2), status NVARCHAR(20),
created_at DATETIME2 DEFAULT SYSUTCDATETIME(),
updated_at DATETIME2 DEFAULT SYSUTCDATETIME());
Now enable CDC on the database and on each table, and give OLake Go a read-only login:
USE shop;
EXEC sys.sp_cdc_enable_db;
EXEC sys.sp_cdc_enable_table @source_schema = N'dbo', @source_name = N'customers', @role_name = NULL;
EXEC sys.sp_cdc_enable_table @source_schema = N'dbo', @source_name = N'orders', @role_name = NULL;
USE master;
CREATE LOGIN olake WITH PASSWORD = '<password>';
USE shop;
CREATE USER olake FOR LOGIN olake;
GRANT SELECT ON SCHEMA :: dbo TO olake;
GRANT SELECT ON SCHEMA :: cdc TO olake;
GRANT VIEW DATABASE STATE TO olake;
-- OLake Go reads the capture job definition before each sync
USE msdb;
CREATE USER olake FOR LOGIN olake;
GRANT SELECT ON dbo.cdc_jobs TO olake;
Check it before moving on:
SELECT name, is_cdc_enabled FROM sys.databases WHERE name = 'shop'; -- 1
SELECT capture_instance FROM cdc.change_tables; -- dbo_customers, dbo_orders
EXEC msdb.dbo.sp_help_job @job_name = N'cdc.shop_capture'; -- the Agent job exists
Things that matter on a real server:
-
The Agent has to run. Without it the change tables stay empty, and SQL Server raises no error.
EXEC master.dbo.xp_servicecontrol 'QueryState', 'SQLServerAgent'returnsRunning.when it is up; on a virtual machine (VM), start theSQLSERVERAGENTservice. -
Change rows live three days by default. A job paused longer than that needs a fresh snapshot, so raise retention with
sys.sp_cdc_change_jobbefore a planned pause. -
Hosted SQL Server swaps the database step for
msdb.dbo.rds_cdc_enable_dbon Amazon Relational Database Service (RDS) ormsdb.dbo.gcloudsql_cdc_enable_dbon Cloud SQL. The table step and the login are unchanged. - Primary keys. Without one, inserts replicate but updates and deletes are not applied.
Step 2: Prepare Snowflake
Open a Snowsight worksheet and run this once as ACCOUNTADMIN. It creates the database, a role OLake Go writes as, a service user, the network policy and a programmatic access token (PAT):
USE ROLE ACCOUNTADMIN;
CREATE WAREHOUSE IF NOT EXISTS OLAKE_WH WAREHOUSE_SIZE = XSMALL AUTO_SUSPEND = 60 AUTO_RESUME = TRUE;
CREATE DATABASE IF NOT EXISTS OLAKE_DEMO;
ALTER DATABASE OLAKE_DEMO SET CATALOG = 'SNOWFLAKE';
ALTER DATABASE OLAKE_DEMO SET EXTERNAL_VOLUME = 'SNOWFLAKE_MANAGED';
CREATE ROLE IF NOT EXISTS OLAKE_ROLE;
GRANT USAGE, CREATE SCHEMA ON DATABASE OLAKE_DEMO TO ROLE OLAKE_ROLE;
GRANT USAGE ON WAREHOUSE OLAKE_WH TO ROLE OLAKE_ROLE;
GRANT ROLE OLAKE_ROLE TO ROLE SYSADMIN;
CREATE USER IF NOT EXISTS OLAKE_SVC TYPE = SERVICE DEFAULT_ROLE = OLAKE_ROLE;
GRANT ROLE OLAKE_ROLE TO USER OLAKE_SVC;
USE SCHEMA OLAKE_DEMO.PUBLIC;
CREATE NETWORK RULE IF NOT EXISTS olake_ip
MODE = INGRESS TYPE = IPV4 VALUE_LIST = ('<OLake Go egress IP>/32');
CREATE NETWORK POLICY IF NOT EXISTS olake_network_policy
ALLOWED_NETWORK_RULE_LIST = ('OLAKE_DEMO.PUBLIC.olake_ip');
ALTER USER OLAKE_SVC SET NETWORK_POLICY = olake_network_policy;
SELECT CURRENT_ORGANIZATION_NAME() || '-' || CURRENT_ACCOUNT_NAME() AS account_identifier,
CURRENT_REGION() AS region;
ALTER USER OLAKE_SVC ADD PROGRAMMATIC ACCESS TOKEN OLAKE_PAT
ROLE_RESTRICTION = 'OLAKE_ROLE' DAYS_TO_EXPIRY = 30;
The two ALTER DATABASE lines make every table OLake Go creates a Snowflake-managed Iceberg table on Snowflake's storage, so there is no CREATE ICEBERG TABLE or external volume later.
Note the account_identifier, the region and the token, which Snowflake displays only once. curl -s https://checkip.amazonaws.com prints your public IP for the network rule.
⚠️ Skip the network policy and the token statement fails with
Network Policy is required when creating a programmatic access token for user OLAKE_SVC.
Step 3: Start OLake UI and add SQL Server as a source
curl -sSL https://raw.githubusercontent.com/datazip-inc/olake-ui/master/docker-compose-v1.yml | docker compose -f - up -d
Open http://localhost:8000 and log in with the default admin account. Go to Sources, click Create Source and pick MSSQL.
Leave Enable CDC on and Manage Capture Instance off (see the tips on schema changes). My connection details: host host.docker.internal (SQL Server ran in another container), port 1433, database shop, user olake and SSL mode disable. Click Set up source, and OLake Go tests the login, then checks CDC on the database, a capture instance per table and a readable capture job.
Step 4: Point the destination at Horizon
Go to Destinations, click Create Destination, pick Apache Iceberg, then catalog type Horizon and authentication Programmatic Access Token (PAT):
| Field | Value |
|---|---|
| Horizon Iceberg REST Catalog URI | https://<account_identifier>.snowflakecomputing.com/polaris/api/catalog |
| Snowflake Database | OLAKE_DEMO |
| Session Role Scope | session:role:OLAKE_ROLE |
| Programmatic Access Token | the token from step 2 |
| Cloud Storage Region | the region from step 2, AWS_AP_SOUTH_1 in my run |
Click Create. OLake Go exchanges the token with Horizon before saving, so a blocked IP or a wrong scope fails here instead of in the middle of a sync.
Step 5: Create the job and run the first sync
Go to Jobs and click Create Job. I named mine sql_server_to_snowflake and picked the new source and destination.
Under Advanced Settings, set Target Query Engines to Snowflake, plus DuckDB and Apache Spark if they will read the tables. That list is the only format decision you make: OLake Go works out an Iceberg delete format every listed engine reads and sets it on each stream.
Click Next. On the Streams page, tick customers and orders, keep Full Refresh + CDC and Upsert, and leave the upsert type as resolved (Positional Deletes in my run).
Click Create Job, then Sync Now from the job's menu. The first run copied 48 records (3.05 KB) in 37 seconds, container start included.
The schema name joins the job, the source database and the schema: sql_server_to_snowflake_shop_dbo. The Iceberg DB field at the top of the Streams page renames it before the first sync.
Step 6: Query the tables in Snowflake
SHOW ICEBERG TABLES IN SCHEMA OLAKE_DEMO."sql_server_to_snowflake_shop_dbo";
SELECT "id", "name", "city", "tier", "_op_type"
FROM OLAKE_DEMO."sql_server_to_snowflake_shop_dbo"."customers"
ORDER BY "id";
There is no registration step and nothing to refresh. SHOW ICEBERG TABLES lists both tables with iceberg_table_type = MANAGED on SNOWFLAKE_MANAGED storage.
Quote every name. OLake Go keeps the lowercase SQL Server names, and Snowflake upper-cases an unquoted identifier into one that does not exist.
Each table also carries OLake Go's own columns: _olake_id, _op_type, _olake_timestamp and _cdc_timestamp, plus _cdc_start_lsn and _cdc_seqval, the log position each SQL Server change came from. Right after the first sync every _op_type is r, a snapshot row.
Step 7: Change rows in SQL Server and sync again
After the first sync, the run made 12 changes, 7 inserts and 5 updates:
INSERT INTO dbo.customers (name, email, city, tier) VALUES
(N'Maya Patel', 'maya@example.com', N'Pune', 'silver'),
(N'Lucas Silva', 'lucas@example.com', N'São Paulo', 'bronze');
INSERT INTO dbo.orders (customer_id, product, amount, status) VALUES
(9, 'Laptop', 1299.00, 'placed'), (9, 'Mouse', 25.50, 'placed'),
(10, 'Monitor', 349.99, 'placed'), (3, 'Keyboard', 89.00, 'placed'), (7, 'Webcam', 79.90, 'placed');
UPDATE dbo.customers SET tier = 'gold', updated_at = SYSUTCDATETIME() WHERE name = N'Liam Carter';
UPDATE dbo.customers SET city = N'Abu Dhabi', updated_at = SYSUTCDATETIME() WHERE name = N'Zara Ali';
UPDATE dbo.orders SET status = 'delivered', updated_at = SYSUTCDATETIME() WHERE id IN (1, 4, 7);
Hit Sync Now again. The second sync pulled 12 records (855 bytes) from the change tables and finished in 18 seconds.
For customers, that sync wrote one data file holding 4 rows: the 2 inserts and the new versions of the 2 updated rows. A single positional delete file retired the 2 old versions, and orders followed the same pattern with 8 rows and 3 deletes.
Re-run the SELECT in Snowsight with no refresh. Liam Carter is now gold, Zara Ali lives in Abu Dhabi, and the two new customers sit at ids 9 and 10 with _op_type c, next to u on the updated rows.
A change made seconds before the sync can be missing. The Agent's capture job copies log records into the change tables every few seconds, so a very fresh write lands one sync later.
Read the same tables from DuckDB
These are Iceberg tables in Snowflake's catalog, so another engine reads the same files without an export. DuckDB wants a short-lived bearer token, so exchange the PAT first:
curl -s -X POST "https://<account_identifier>.snowflakecomputing.com/polaris/api/catalog/v1/oauth/tokens" \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode grant_type=client_credentials \
--data-urlencode scope=session:role:OLAKE_ROLE \
--data-urlencode client_secret=<your PAT>
INSTALL iceberg; LOAD iceberg;
INSTALL httpfs; LOAD httpfs;
CREATE SECRET horizon_secret (TYPE iceberg, TOKEN '<access_token from /v1/oauth/tokens>');
ATTACH 'OLAKE_DEMO' AS horizon (
TYPE iceberg,
ENDPOINT 'https://<account_identifier>.snowflakecomputing.com/polaris/api/catalog',
SECRET horizon_secret,
ACCESS_DELEGATION_MODE 'vended_credentials'
);
SELECT id, name, city, tier FROM horizon.sql_server_to_snowflake_shop_dbo.customers ORDER BY id;
DuckDB 1.5.5 returned the same 10 customers, and so did Spark 3.5.6 with Iceberg 1.10.0. An orders roll-up matched SQL Server to the cent in all three engines: 16 delivered for 8659.68, 18 placed for 10522.26 and 11 shipped for 6397.25.
The session token lasts about an hour. DuckDB only attaches catalogs backed by S3, S3 Tables or Google Cloud Storage, so this path needs a Snowflake account hosted on AWS or Google Cloud.
Tips from the run
-
Untick
systranschemas. Enabling CDC addsdbo.systranschemasto the database, discovery lists it, and it has no capture instance. Select it and the first sync stops withCDC is not enabled for stream dbo.systranschemas. -
A new column needs a new capture instance. Create one by hand, or turn on Manage Capture Instance (it needs
db_owner), and OLake Go adds the column on the next sync. Narrowing type changes fail the sync instead of corrupting the table. -
Decimals arrive as
FLOAT. The sums above still matched to the cent, but round at query time for exact decimal arithmetic. -
datetime2is read as UTC and shows up asTIMESTAMP_LTZ(6). Set the session time zone before comparing. - Rotate the token. It lasts 30 days in the setup above and 365 at most. An expired token fails the next sync at the catalog handshake, before any data moves.
-
Plan for compaction. Snowflake expires snapshots and compacts manifests on these tables at no cost, but data-file compaction is bundled only when Snowflake alone writes the table. Spark's
rewrite_data_filesworks through the same Horizon endpoint.
How the SQL Server to Snowflake options compare
| Method | Freshness | Updates and deletes | Where the data lands | What you run |
|---|---|---|---|---|
bcp or SSIS, then COPY INTO
|
hours to daily | no, full reloads | files, then Snowflake tables | a script and a scheduler |
| Debezium, Kafka, Snowflake Kafka connector | seconds | yes, with tombstone handling | Kafka topics, then Snowflake tables | Kafka, Connect, Debezium, schema registry |
| Fivetran, Estuary, Airbyte Cloud | minutes, by plan | yes | a second copy in Snowflake | nothing; per row, per GB or per connector |
| Snowflake Openflow | change tracking or CDC | yes, as soft deletes | native Snowflake tables | an Openflow deployment, billed in credits |
| OLake Go into Horizon (this post) | CDC on a schedule, down to one minute | yes, as Iceberg row-level deletes | Iceberg tables that Snowflake, DuckDB, Spark and Trino read | one Docker Compose stack, open source |
If Snowflake will stay the only reader and you would rather Snowflake ran the pipeline, Openflow is the shorter path. Writing Iceberg once pays off as soon as a second engine needs the rows, or when you want to own the files.
FAQ
Which SQL Server editions can I use for this?
Developer, Standard from 2016 SP1, and Enterprise all have CDC. Express and Web do not, and Azure SQL Database needs the S3 tier or higher. Without CDC, OLake Go can still run Full Refresh or Full Refresh + Incremental on an updated_at column.
Does OLake Go spend Snowflake warehouse credits to write?
No. OLake Go runs wherever Docker runs and writes the files itself, so the warehouse only wakes up for your queries. With SNOWFLAKE_MANAGED storage the files are billed at Snowflake storage rates.
Do deletes in SQL Server reach Snowflake too?
Yes. Later syncs replay deletes from the change tables along with inserts and updates, and _op_type uses d for a delete. My run only inserted and updated rows, so the screenshots show c and u.
Where do the files live if I would rather keep them in S3?
Use AWS Glue as the catalog instead of Horizon. The files then sit in your bucket, Snowflake reads them through a catalog integration that you refresh after each sync, and Athena, Redshift and Amazon Elastic MapReduce (EMR) read the same tables.
Where to go from here
- Point the source at your own database. On RDS or Cloud SQL, only the database-level CDC procedure changes.
- Add a table by running
sys.sp_cdc_enable_tablefor it, then selecting it in the job's streams. - The full guide, with the Glue tabs, the Spark connection and the data type table, is on olake.io.
If a step behaves differently for you, say so in the comments and I'll update the post.






Top comments (0)