Question : SSIS: insert AND delete rows

How can I use SSIS to insert AND delete rows in a SQL Server table based on an an action code contained in each row of a flat file?  Each row in the flat file contains an ACTION_CODE, an ID, and other data.  If the ACTION_CODE is 'A' then a row in the SQL Server table is to be inserted containing data from the flat file row including the ID.  If the ACTION_CODE is 'D' then all rows in the SQL Server table with an ID matching the ID in the flat file row are to be deleted.

Answer : SSIS: insert AND delete rows

I would import the complete flatfile to a temp table.
That way you can insert all records with action code 'A' at once and delete all records with action code 'D' at once. Two set based actions ... should be pretty fast .

Hope this helps ...
Random Solutions  
 
programming4us programming4us