I am moving to use SqlBulkCopy to deal with large insertions into some databases. This has lead to great performance improvements for one db.
However, another targeted db table is a view composing 2 tables. Applying the single table code leads to "System.Data.SqlClient.SqlException: View or function 'dbo.vwParameter' is not updatable because the modification affects multiple base tables". It is possible to flatten the view into one table without causing many complications, though undesired because it saves a good bit disk space.
So is it possible to use SqlBulkCopy in this context, and I am just doing something wrong? Or if not, what might be a good work-around that preserves the view for reading?
It turned out that SqlBulkCopy ignored my instead of triggers by default. All I had to do was pass SqlBulkCopyOptions.FireTriggers to the SqlBulkCopy constructor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With