SqlBulkCopy: Add hooks to enable retry strategies on batches
- Dominant language
- C#
- Stars
- 989
- Forks
- 340
- Avg merge
- 4d 19h
- Merged PRs (30d)
- 72
Description
If SqlBulkCopy encounters any kind of exception as it inserts rows into a table, it fails the entire job.
In some scenarios, certain errors might be appropriate to retry - for instance, a deadlock or timeout. While this might be unlikely when doing bulk inserts to a staging table, it is much more likely if the table is also shared by a web application, for instance.
For this reason, until now we've instead used Table Valued Parameters.
It would be helpful though if SqlBulkCopy gave us a mechanism to apply a retry strategy as appropriate.
_If this isn't the appropriate place to post suggestions like this, let me know. If there was interest in the above, I would happily investigate the feasibility of this further._
Contributor guide
Assessment
This issue has not been assessed yet.