Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL Bulk Insert and BactchSize

Author  Topic 

Johhny Blay
Starting Member

3 Posts

Posted - 2015-03-31 : 09:34:59
How do you prevent this:

"If you import a very large number of rows, dividing the data into batches can offer advantages. After each batch complete, the transaction is logged. If, for any reason, a bulk-import operation terminates before completion, only the current transaction (batch) is rolled back."

How can I let the whole batch rollback, instead only the current transaction (batch) rolling back?

Thanks

Ref:
https://technet.microsoft.com/en-us/library/ms188267%28v=sql.105%29.aspx


jb

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2015-03-31 : 14:07:18
Is this (from the same page) what you want? "By default, all the rows in a data file are imported as a single batch of unknown size in a single transaction. In this case, if the import operation fails before completion, the entire transaction is rolled back, and no data is added to the destination table"
Go to Top of Page
   

- Advertisement -