sql server - BatchUpdateException updateCounts return inconsistent results -


i trying find way recognise item failed in batch insert using sql server (driver: sqljdbc4).

i created tiny test case sends varchar out of range got

"java.sql.batchupdateexception: string or binary data truncated."

i cannot understand value of updatecounts, follows:

when first batch insert causes error : => updatecounts -3

when 2nd batch insert causes error : => update counts: -3, 1, 1, 1

when 3rd batch insert causes error : => update counts: 1, -3, 1, 1

when 4rd batch insert causes error : => update counts: 1, 1, -3, 1

when 5th batch insert causes error : => update counts: 1, 1, 1, -3

i sending 5 items time, expecting 5 items in updatecounts.

does see pattern here can identify wrong item?


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - How to Hide Date Menu from Datepicker in yii2 -