Toad World® Forums

Toad Data Modeler 6.3 - Building a Trigger from the Triggers Tab


#1

Hello, All!

Attempting to construct a new BEFORE UPDATE trigger for a table in order to maintain an easily searchable audit trail available from the UI. I’ve seen selectable trigger fire options BEFORE & AFTER while working with other modelling tools; here, I only see AFTER & INSTEAD OF. Usually, I’d create a trigger to write to the audit table BEFORE an existing record was updated to preserve it. Is that what the INSTEAD OF trigger fire option is for?

Or, because the UPDATE event inserts into BOTH Inserted & Deleted tables, the AFTER trigger fire option will read from the Deleted table & insert that ‘old’ record into the history table?

Thank you for your assistance!
Toadv63-TriggerTab_20180514.docx (35.7 KB)


#2

Hi,

SQL Server does not support BEFORE trigger, therefore Toad Data Modeler does not support this type of trigger too (for SQL Server).

Documentation of CREATE TRIGGER command in SQL Server:

docs.microsoft.com/…/create-trigger-transact-sql

Some discussion about BEFORE trigger in SQL Server:

https://stackoverflow.com/questions/642822/how-can-i-do-a-before-updated-trigger-with-sql-server


#3

Thank you very much, Mario.Tkacik! Not the answer I wanted, but certainly one I can live with. Much obliged.