본문으로 건너뛰기
cccskills
무료GitHub에 공개

capture-sqlserver-create

Create a SQL Server CDC capture using flowctl. Use when setting up real-time streaming from SQL Server, Azure SQL, Amazon RDS SQL Server, or Google Cloud SQL. Use when user says "capture SQL Server", "stream from MSSQL", "SQL Server CDC", or "connect SQL Server to Estuary".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

연동 도구Google CloudAzure
설치 방법 보기

포함된 파일(1)

  • SKILL.md8.0 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Create SQL Server Capture

Create an Estuary capture from Microsoft SQL Server using Change Data Capture (CDC).

Applies to: source-sqlserver, source-amazon-rds-sqlserver, source-google-cloud-sql-sqlserver, source-azure-sqlserver

Step 0: Load Connector Documentation

Before proceeding, fetch the official connector docs for prerequisites, config reference, and cloud-specific setup.

Always load the main page: https://docs.estuary.dev/reference/Connectors/capture-connectors/SQLServer/

Then load the variant subpage based on the user's SQL Server type:

VariantDocs URL
Self-hosted SQL ServerMain page covers this
Azure SQL DatabaseMain page covers this
Amazon RDS SQL Serverhttps://docs.estuary.dev/reference/Connectors/capture-connectors/SQLServer/amazon-rds-sqlserver/
Google Cloud SQLhttps://docs.estuary.dev/reference/Connectors/capture-connectors/SQLServer/google-cloud-sql-sqlserver/

Use WebFetch to load these pages. Together they cover:

  • Prerequisites (CDC enable at database and table level, user permissions)
  • Full config property reference
  • Cloud-specific setup instructions
  • SSH tunnel configuration
  • Network access / IP allowlisting

This skill provides the flowctl workflow and troubleshooting that docs don't cover.

Step 1: Gather Requirements

Before writing any YAML, ask the user:

  1. SQL Server variant? — Self-hosted, Azure SQL Database, Amazon RDS, or Google Cloud SQL
  2. Edition? — CDC requires Enterprise, Developer, or Evaluation (not Standard/Express). Azure SQL supports all tiers.
  3. Network path? — Direct connection (cloud with IP allowlist), SSH tunnel (private network), Private Link (AWS/Azure/GCP), or ngrok (local dev)
  4. Non-default data plane? — Most users use the default. Ask if they need a non-default data plane.
  5. Tables to capture? — Which specific tables (CDC must be enabled per table)
  6. History mode? — Standard CDC (false) or full event history (true)

Step 2: Find the Correct Connector Version

Always use the latest numbered version tag. Query the connector registry to find it:

flowctl raw get --table connector_tags \
  --query 'documentation_url=ilike.*source-sqlserver*' \
  --query 'select=image_tag,documentation_url' \
  --output yaml

Choose the connector image:

VariantConnector Image
Self-hosted / Azure SQLghcr.io/estuary/source-sqlserver
Amazon RDS SQL Serverghcr.io/estuary/source-amazon-rds-sqlserver
Google Cloud SQLghcr.io/estuary/source-google-cloud-sql-sqlserver

Step 3: Help User Complete Prerequisites

Walk the user through prerequisites from the docs loaded in Step 0. SQL Server CDC setup is more involved than other databases:

  1. SQL Server Agent MUST be running — The Agent runs CDC capture/cleanup jobs. Without it, CDC data won't be processed. Azure SQL doesn't need this (managed automatically).
  2. Enable CDC on database — The command varies by platform:
    • Standard: EXEC sys.sp_cdc_enable_db;
    • RDS: EXEC msdb.dbo.rds_cdc_enable_db '<db>';
    • Cloud SQL: EXEC msdb.dbo.gcloudsql_cdc_enable_db '<db>';
  3. Enable CDC on each table — Must be done individually per table
  4. User permissions — SELECT on dbo and cdc schemas, VIEW DATABASE STATE

Step 4: Create the Capture Spec File

Build flow.yaml using the config reference from the docs. Minimal required config:

captures:
  <tenant>/<path>/source-sqlserver:
    endpoint:
      connector:
        image: ghcr.io/estuary/source-sqlserver:<version>
        config:
          address: "<host>:1433"
          database: "<database>"
          user: "<username>"
          password: "<password>"
          historyMode: false
    bindings: []

For SSH tunnel, add networkTunnel.sshForwarding block — see docs for full config.

Step 5: Discover and Publish

# Discover CDC-enabled tables
flowctl discover --source flow.yaml

# Review the generated bindings
cat flow.yaml

# Publish the capture
flowctl catalog publish --source flow.yaml --auto-approve

Note: Only tables with CDC enabled will appear in discovery results. If a table is missing, it needs CDC enabled first.

Step 6: Verify

# Check status (expect PENDING → BACKFILLING → OK: Streaming CDC Events)
flowctl catalog status <tenant>/<path>/source-sqlserver

# View recent logs
flowctl logs --task <tenant>/<path>/source-sqlserver --since 5m | jq -c '{ts, message}'

# Read captured data
flowctl collections read --collection <tenant>/<path>/dbo/<table> | head -10

Status progression:

  1. PENDING — normal for ~30 seconds during shard assignment
  2. BACKFILLING — initial table snapshots
  3. OK: Streaming CDC Events — CDC running normally

Troubleshooting

"CDC is not enabled for the database"

Cause: Database-level CDC not enabled

Fix: Run the appropriate enable command for your platform (see Step 3).

"table has no capture instances"

Cause: CDC not enabled on the specific table

Fix:

EXEC sys.sp_cdc_enable_table
    @source_schema = 'dbo',
    @source_name = 'your_table',
    @role_name = 'flow_capture',
    @supports_net_changes = 1;

"no valid capture instances for stream"

Cause: Table was dropped and recreated, CDC capture instance has newer start LSN

Fix: Increment backfill counter on the binding:

bindings:
  - resource:
      namespace: dbo
      stream: your_table
      backfill: 1  # Increment this
    target: tenant/path/dbo/your_table

"maximum CDC LSN is currently unset"

Cause: SQL Server Agent is not running, CDC jobs aren't processing

Fix: Start SQL Server Agent service. Verify jobs exist: EXEC sys.sp_cdc_help_jobs;

"CDC worker may not be running" or fence position errors

Cause: CDC capture job is missing, stopped, or broken

Diagnostic:

SELECT name, is_cdc_enabled FROM sys.databases WHERE name = DB_NAME();
EXEC sys.sp_cdc_help_jobs;
SELECT * FROM sys.dm_cdc_log_scan_sessions ORDER BY start_time DESC;

Fix: If jobs missing, recreate:

EXEC sys.sp_cdc_add_job @job_type = 'capture';
EXEC sys.sp_cdc_add_job @job_type = 'cleanup';

"invalid '__$start_lsn' value"

Cause: CDC role_name mismatch — user not in the correct role

Fix: Check role and add user:

SELECT capture_instance, role_name FROM cdc.change_tables;
EXEC sp_addrolemember '<role_name>', 'flow_capture';

RoleName:'null' issue

Cause: Literal string "null" used as role_name instead of SQL NULL

Fix: Re-enable CDC with NULL role:

EXEC sys.sp_cdc_disable_table @source_schema = 'dbo', @source_name = 'table', @capture_instance = 'all';
EXEC sys.sp_cdc_enable_table @source_schema = 'dbo', @source_name = 'table', @role_name = NULL, @supports_net_changes = 1;

CDC partially enabled (broken state)

Symptoms: CDC commands fail with errors like "user cdc already exists"

Fix: Disable and re-enable CDC at database level:

EXEC sys.sp_cdc_disable_db;
EXEC sys.sp_cdc_enable_db;
-- Then re-enable on each table

Permission denied on dbo or cdc schema

Fix:

GRANT SELECT ON SCHEMA::dbo TO flow_capture;
GRANT SELECT ON SCHEMA::cdc TO flow_capture;
GRANT VIEW DATABASE STATE TO flow_capture;

Capture stuck in PENDING

Wait 30-60 seconds — this is normal during shard assignment. If still stuck:

flowctl logs --task <tenant>/<path>/source-sqlserver --since 5m | jq 'select(.level == "error" or .level == "warn")'

Related Skills

  • connector-disable-enable — Pause/restart existing captures
  • connector-delete-recreate — Nuclear option for stuck captures
  • estuary-logs — Deep log analysis
  • estuary-catalog-status — Status checking

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Create an Alpaca capture using flowctl to stream stock trade data into Estuary collections. Use when setting up an Alpaca Market Data source for historical and real-time stock trades. Use when user says "capture Alpaca", "stream stock trades", "Alpaca market data", or "connect Alpaca to Estuary".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

estuary/agent-skills72026년 9월 25일 업데이트

Create a capture for ANY Estuary connector using dynamic schema discovery. Use when the user wants to capture from a source that doesn't have a dedicated skill (e.g., Kafka, Salesforce, HubSpot, Stripe, S3, GCS, Kinesis, or any of the 148+ connectors). Use when user says "capture from <source>", "stream from <source>", "connect <source> to Estuary", or "set up <source> capture" and no connector-specific skill exists.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

estuary/agent-skills72026년 9월 25일 업데이트

Create an HTTP Ingest (webhook) capture to receive data via HTTP POST requests. Use when setting up webhooks from GitHub, Shopify, Stripe, or any JSON source. Use when user says "set up webhook capture", "HTTP ingest to Estuary", "receive POST requests to Estuary", or "webhook capture".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

estuary/agent-skills72026년 9월 25일 업데이트

Create a HubSpot Real-Time capture using flowctl to stream CRM data into Estuary collections. Use when setting up a HubSpot source for contacts, companies, deals, tickets, or other HubSpot resources. Use when user says "capture HubSpot", "stream from HubSpot", "HubSpot CDC", or "connect HubSpot to Estuary".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

estuary/agent-skills72026년 9월 25일 업데이트

Create a MongoDB CDC capture using flowctl. Use when setting up real-time streaming from MongoDB Atlas, DocumentDB, or self-hosted MongoDB. Use when user says "capture MongoDB", "stream from Mongo", "MongoDB CDC", or "connect MongoDB to Estuary".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

estuary/agent-skills72026년 9월 25일 업데이트

Create a MySQL CDC capture using flowctl with binlog replication. Use when setting up streaming from MySQL, Amazon RDS MySQL, or Aurora MySQL. Use when user says "capture MySQL", "stream from MySQL", "MySQL CDC", "binlog replication", or "connect MySQL to Estuary".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

estuary/agent-skills72026년 9월 25일 업데이트

estuary의 스킬 모두 보기

이 스킬의 문제 신고