Describe the bug
Sometimes Bulk Insert returns the result where RowsAffected() is less than we sent (or wanted to insert). For instance, we sent 9506 rows, but RowsAffected() returned 5839.
It doesn't happen often, maybe once every six months. But when it happens, if we run the same code again, the expected number of rows will be inserted successfully, hence the data that we insert is valid. There are no errors returned also, so no way we can reproduce it.
I'm open to any ideas/suggestions of how to get to the bottom of this.
Describe the bug Sometimes Bulk Insert returns the result where RowsAffected() is less than we sent (or wanted to insert). For instance, we sent 9506 rows, but RowsAffected() returned 5839.
It doesn't happen often, maybe once every six months. But when it happens, if we run the same code again, the expected number of rows will be inserted successfully, hence the data that we insert is valid. There are no errors returned also, so no way we can reproduce it.
I'm open to any ideas/suggestions of how to get to the bottom of this.
Below is example of code:
Further technical details
SQL Server version: Microsoft SQL Azure (RTM) - 12.0.2000.8 Operating system: Docker container