Disable Enable Trigger SQL server for a table
use the following commands instead:
ALTER TABLE table_name DISABLE TRIGGER tr_name
ALTER TABLE table_name ENABLE TRIGGER tr_name
The line before needs to end with a ;
because in SQL DISABLE
is not a keyword. For example:
BEGIN
;
DISABLE TRIGGER ...
After the ENABLE TRIGGER OR DISABLE TRIGGER in a new line write GO, Example:
DISABLE TRIGGER dbo.tr_name ON dbo.table_name
GO
-- some update statement
ENABLE TRIGGER dbo.tr_name ON dbo.table_name
GO
As Mark mentioned, the previous statement should be ended in semi-colon. So you can use:
; DISABLE TRIGGER dbo.tr_name ON dbo.table_name