zzzprojects / Bulk-Operations

C# SQL Bulk Operations | High-performance C# bulk insert, update, delete and merge for SQL Server, SQL Azure, SQL Compact, MySQL, and SQLite.
https://bulk-operations.net
142 stars 34 forks source link

Transactions #17

Closed observer1 closed 6 years ago

observer1 commented 6 years ago

Hi Whats the right way to use a transaction that rollbacks the whole bulkinsert, we have tried a few combinations but always some data gets persisted. Can you provide some example code?

Thanks for your help

JonathanMagnan commented 6 years ago

Hello @observer1 ,

The following options should handle your scenario operation.InternalTransaction = InternalTransactionType.ByOperation;

However, we recommend you to control yourself the transaction.

Let me know if you try the option if that worked.

Best Regards,

Jonathan

observer1 commented 6 years ago

It seems to be working know I'm closing this