<@U04S8PLJWMT> When using cursor based syncs to sy...
# ask-ai
f
@kapa.ai When using cursor based syncs to sync data from sql server to snowflake when record is deleted from source stream it does not get removed from the destination or gets marked as deleted from destination. How can we resolve this?
k
When using cursor-based incremental syncs (such as Incremental Append or Incremental Deduped + History) in Airbyte to sync data from SQL Server to Snowflake, deletions in the source are not automatically propagated to the destination. This means that if a record is deleted from the source, it will remain in the destination unless you take additional steps. This is a known limitation of cursor-based incremental syncs: deleted records are not removed or marked as deleted in the destination. The destination will only reflect new or updated records, not deletions from the source [see docs](https://docs.airbyte.com/platform/using-airbyte/core-concepts/sync-modes/incremental-append#known-limitations) [see tutorial](https://airbyte.com/tutorials/incremental-data-synchronization#step-7). ### How to resolve this There are a few approaches you can take: 1. Use Change Data Capture (CDC) Syncs If you need deletions to be reflected in the destination, you should use Airbyte’s CDC sync mode. CDC tracks inserts, updates, and deletes, and can propagate delete events to the destination. For SQL Server, Airbyte supports CDC using SQL Server’s built-in CDC feature. When a record is deleted in the source, a delete event is captured and a special field (e.g.,
_ab_cdc_deleted_at
) is set in the destination to indicate the deletion [see CDC tutorial](https://airbyte.com/tutorials/incremental-change-data-capture-cdc-replication) [see docs](https://docs.airbyte.com/integrations/sources/mssql#change-data-capture-cdc). 2. Use Full Refresh - Overwrite Syncs If CDC is not an option, you can use the Full Refresh - Overwrite sync mode. This will completely replace the destination table with the current state of the source table on each sync, ensuring that deleted records are also removed. However, this can be expensive and slow for large datasets [see docs](https://docs.airbyte.com/platform/using-airbyte/core-concepts/sync-modes/incremental-append#known-limitations). 3. Implement Soft Deletes If you cannot use CDC or Full Refresh, you may consider implementing soft deletes in your source system (e.g., adding a
deleted
flag to records instead of physically deleting them). This way, the incremental sync can pick up the change and update the destination accordingly [see tutorial](https://airbyte.com/tutorials/incremental-data-synchronization#step-8). Summary: To have deletions reflected in your destination (Snowflake), you should use CDC syncs if possible. Cursor-based incremental syncs do not handle deletions. If CDC is not available, consider Full Refresh - Overwrite or soft delete strategies. For more details, see the Airbyte documentation on [Incremental Sync - Append: Known Limitations](https://docs.airbyte.com/platform/using-airbyte/core-concepts/sync-modes/incremental-append#known-limitations) and [CDC for SQL Server](https://docs.airbyte.com/integrations/sources/mssql#change-data-capture-cdc).