c# - If network connection is lost while inserting large amount of data, what will happen? -


i using asp.net c# , sql server. inserting 10000 records sequentially.

assume after inserting 6000 records, network connection lost. @ time happen? the 6000 records inserted or not?

if 6000 records inserted - remaining 4000 records, , how identify how many records inserted , how reverse 6000 records?

is there other option rectify problem? if problem occurred need to solve it? there should no duplicate data in end.

it depends consider inserting.

10.000 insert statements, no transaction: nothing rolled back.

10k insert statements in transaction - rollback of operations.

best way plan that:

  • use sqlbulkcopy temporary table, isnert there final table (sqlbulkcopy has serious issues concurrent table access bypass this).
  • use merge move final table.

plan rerunning insert - mergfe makes sure of (no cleanup needed).


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -