How to truncate all SQL tables prior to copy activities using Azure Data Factory v2?


  • I am copying data from on-prem SQL Server to Azure SQL database using Azure Data Factory v2. Before the pipeline copy each table, I need to truncate each table. Is there a variable I can use instead of the table name? That way I can use the same query for each <g class="gr_ gr_481 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del" data-gr-id="481" id="481">dataflow</g>. Something like "Delete from Mytable".


    joi, 24 mai 2018 12:30


  • You could use foreach + copy activity. Pass al table names to your foreach items. And then you could use expressions in preCopyScript like "Delete from @{item()}. Also in your copy activity input/output dataset, you could referece @item().
    joi, 24 mai 2018 13:34

Toate mesajele