Focal Point
How to delete from source after adding to target?

This topic can be found at:

May 17, 2007, 03:23 PM
How to delete from source after adding to target?
In Data Migrator, I have a need to move data from a staging table into a finalized table, transforming it as I go. After the transformation, if the record passes muster, I want to delete the record from the staging table. If it doesn't pass muster, I want to leave it in the staging table where it will be addressed via user intervention. I have devised a two flow process where I make the insertion in flow 1, and then in flow 2 join the staging and finalized tables, deleting where matches exist. This seems straightforward.

But some complication comes into play in the event the same record gets submitted twice in the same run. This is a possible situation as the end user can update records multiple times between runs. In this event, the keying on the duplicates is the same.

Is there a part of the tool that allows me to delete the record in the source and insert the record in the target in the same flow? This would allow me to delete or save the record as appropriate.

SQL Server 2005 for both tables, Data Migrator 7.6.1.

May 17, 2007, 03:57 PM
I have chosen to tackle this problem with a SQL Server "Unique Identifier" field type that will give each record in the staging table a unique key to search on. The mapping algorithm will carry this field to the result table and I will use it in the deletion process in the second flow.

Thanks anyway!