Updated on 2025-12-30 GMT+08:00

Using DRS to Synchronize Data After Table Structure Changes by Adding or Deleting Tables

Execution Policy of DRS Synchronization Tasks When Tables Are Added or Deleted in the Source Azure SQL DB

If tables are added, deleted, or modified during incremental synchronization of the SSMS object structure, DRS synchronization may fail. After the incremental synchronization is complete, perform the following operations to restore the DRS synchronization task:

  1. If tables are added during synchronization of the source Azure SQL DB, manually add the new tables to the synchronization task based on the new table content in the SSMS incremental synchronization report and then restart the synchronization task.
  2. If tables are deleted during synchronization of the source Azure SQL DB, the DRS synchronization task fails. In this case, manually delete the tables from the synchronization task based on the deleted table content in the SSMS incremental synchronization report and then resume the synchronization task.

Execution Policy of DRS Synchronization Tasks When Table Structures Are Changed in the Source Azure SQL DB

If the table structure changes during synchronization of the source Azure SQL DB, data may be inconsistent or the task may fail because CDC does not record DDL changes. (For example, if a column is added to the source, CDC does not record changes related to the new column. As a result, the new column information is missing after the data is synchronized to the destination.)

  1. Pre-action: After the table data is cleared and before the table is added again:
    1. Perform the same DDL operations on the destination as those on the source to ensure that the source and destination structures are the same.
    2. Enable CDC for the table where DDL operations are performed on the source.
  2. Edit the DRS task to delete the table from the synchronization object, clear the table data in the destination database, and add the table again to the synchronization object.