Ausgabe
Ich möchte eine Prozedur wie unten erstellen, aber sie hat einen Syntaxfehler. Könnte jemand auf das Problem hinweisen?
Create PROCEDURE [dbo].[my_proc] AS
BEGIN
DISABLE TRIGGER dbo.tr_name ON dbo.table_name
-- some update statement
ENABLE TRIGGER dbo.tr_name ON dbo.table_name
END
** Error Message : Incorrect syntax near 'ENABLE'.
Lösung
Verwenden Sie stattdessen die folgenden Befehle:
ALTER TABLE table_name DISABLE TRIGGER tr_name
ALTER TABLE table_name ENABLE TRIGGER tr_name
Beantwortet von – Wael Dalloul
Antwort geprüft von – Jay B. (FixError Admin)