SqlBulkCopy Tutorial SqlBulkCopy - Recommended SqlBulkCopyOptions
Which SqlBulkCopy options should we use by default?
For common scenario:
var options = SqlBulkCopyOptions.CheckConstraints | SqlBulkCopyOptions.FireTriggers | SqlBulkCopyOptions.TableLock;
By default, all options are turned off which is very bad.
Even if your table doesn't yet have a constraint or trigger you need know what could happen in a year.
Still not sure about which default option to use?
- Talk to your team
- Agreed on which default options to use within the company
- Stick with it unless you have a special scenario