开发者

How to turn off triggers while using LinqToSQL

开发者 https://www.devze.com 2023-02-21 01:33 出处:网络
I have DB table with update开发者_开发知识库 trigger (to track history of changes). I want to use LinqToSql to do large changes on that table. But to do that fast I have to: turn off trigger, make cha

I have DB table with update开发者_开发知识库 trigger (to track history of changes). I want to use LinqToSql to do large changes on that table. But to do that fast I have to: turn off trigger, make changes and turn on trigger.

Is there any way to enable/disable triggers using LinqToSql?


you would have to use the following from msdn doc

DISABLE TRIGGER { [ schema_name . ] trigger_name [ ,...n ] | ALL } ON { object_name | DATABASE | ALL SERVER } [ ; ]

see also this question on how to execute the above syntax (or any sql) via the DataContext

0

精彩评论

暂无评论...
验证码 换一张
取 消