I have a pipeline with copy data task where I upsert some data from On-Prem SQL into Synapse. The setup is such that I first establish the list of tables and then, in ForEach, I dynamically set Key Columns (from a variable) and do an upsert. The strange part is that occasionally copy data task fails with this error
ErrorCode=SqlUpsertKeyColumnsInvalid,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Sql upsert key column '[some-column-name]' does not exist in the table '[some-schema-name].[InterimTable_9688bbfd-bb01-4a10-b6f6-9832bcb12512]'.,Source=Microsoft.DataTransfer.ClientLibrary,'
When I re-run the pipeline, the error goes away for one table but may occur for another table. There is about 100 tables involved in this copy operation and the amount of data being upserted is not substantial (few hundred records if not less).
Thank you in advance!