Home > Blockchain >  Incremental copy cdc records with dynamic source in Azure ADF
Incremental copy cdc records with dynamic source in Azure ADF

Time:12-16

I have created a pipeline in Azure ADF to copy changed rows from 54 tables in our source db. I have followed the guide from enter image description here

CodePudding user response:

As some of the parameters are missed in the answer will I repost the query here.

@concat('DECLARE @begin_time datetime, @end_time datetime, @from_lsn binary(10), @to_lsn binary(10) ; SET @begin_time = ''',pipeline().parameters.TriggerStartTime,'''; SET @end_time = ''',pipeline().parameters.TriggerEndTime,'''; SET @from_lsn = sys.fn_cdc_map_time_to_lsn(''smallest greater than or equal'', @begin_time); SET @to_lsn = sys.fn_cdc_map_time_to_lsn(''largest less than or equal'', @end_time); SELECT count(1) changecount FROM cdc.fn_cdc_get_net_changes_dbo_',item().Table_Name,'(@from_lsn, @to_lsn, ''all'')')

  • Related