I had never used triggers before on a SQL server, and I looked it up on the Internet but could not find the answer to my question. Basically I am trying to write a trigger that will be fired after the record is updated in the table. This trigger will then update two additional tables based on the record that was updated in the first table.
The primary table with the trigger on it will update one record using this query:
UPDATE E.SM_T_RList SET IsActive = 0 WHERE Guid = @Guid
Then I want the trigger to do something like this:
ALTER TRIGGER [E].[IsActiveUpdate] ON [E].[SM_T_RList] AFTER UPDATE AS BEGIN SET NOCOUNT ON; UPDATE E.SM_T_BInfo SET IsActive = 0 WHERE Guid = @Guid UPDATE E.SM_T_RMachines SET IsActive = 0 WHERE GUID = @GUID END
The manual that I want to update is used by the main table. But I can not understand how I get @Guid, which I want to update in a trigger? Please, help.
thanks
sql-server triggers
Taryn
source share