Forum Discussion
When to Use Pre-Copy Script vs. Source Query in Copy Activity?
- 1 year ago
The difference between the query and the pre-copy script is that the query is performed on the source, while the pre-copy script is performed on the destination. You can use both within the same activity. You could for example delete all the records from the destination before you write new rows from the source to the destination that you've selected with your query.
Pre-copy activity runs in a separate session, then copy command runs. both commands run on the destination. Please note, when pre-copy is used to delete rows then copy the records using the copy activity, there is a chance your destnation table loose data due to no rollback happense after delete if the copy activity fails. This is a situation that we must aware when use truncate or delete in pre-copy activity and this answers my own question.
Thanks!!