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?
Asked
Active
Viewed 1,240 times
1

Marek Kwiendacz
- 9,524
- 14
- 48
- 72
1 Answers
1
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
-
I know how to do that in sql:) But I don't want to do that in SQL Server Management studio. – Marek Kwiendacz Mar 30 '11 at 20:11