原文:
在new SqlBulkCopy对象的时候,设置一下SqlBulkCopyOptions选项即可,按位或运算
SqlBulkCopyOptions.FireTriggers | SqlBulkCopyOptions.CheckConstraints
using (SqlBulkCopy bulkCopy = new SqlBulkCopy(GlobalString.ConnectionString, SqlBulkCopyOptions.CheckConstraints | SqlBulkCopyOptions.FireTriggers)) { //...........}