RepoDB icon indicating copy to clipboard operation
RepoDB copied to clipboard

Bug: BulkInsert returns wrong rows affected result

Open dagmanolis opened this issue 3 years ago • 1 comments

I am using sql server. When I try to Bulk Insert on a table and there is a unique index (not Primary Key) and the index has IGNORE_DUP_KEY = ON and I try to insert duplicate entries then it should return zero (0) rows affected, but instead it returns the count of the collection.

Am I missing something?

dagmanolis avatar Dec 26 '21 20:12 dagmanolis

We have never tried this scenario yet, but if the data you had bulk-inserted in the database is saved in the table as duplicated values, then the result of the number of rows are correct. Unless of course if the data in the database table is merged automatically by SQL Server, which in this case, the ORM is purely disconnected from this behavior.

mikependon avatar Feb 23 '22 22:02 mikependon