I have simple SSIS package which reads data from flat file and insert into SQL database. The file has 90K rows and sometimes because of bad data package fails but it insert the partial records before it fails. What I need is if insertion fails at any time between, no records should be inserted into DB, rollback everything.
how can I put it in transaction?
I have simple SSIS package which reads data from flat file and insert into
Share
Thanks everyone. Finally I got the answer.
There are two ways as far as I experimented on
1. Use transaction option, but I faced issue here. This need your MSDTC service to be running and because of some issues my SQl admin couldn’t make it running for me so I had think of alternative.
2. Use SQL servers Transaction. I used two SQL tasks one for BEGIN TRANSACTION and another for COMMIT TRANSACTION. To make this working I required to set my SQL connection manager’s property “RetainSameConnection” to True. This solved my problem.