I am new to using Triggers and have create one using the code below. I need to enhance it thought and do not know how...
CREATE Trigger ti_Filtered on tangram.XPC_Software_MasterList_Combined
FOR Insert, Update
AS
Update XPC_Software_MasterList
Set XPC_Software_MasterList.Sft_Filtered = 1
From tangram.XPC_Software_MasterList_Combined INNER JOIN
tangram.XPC_Software_MasterList ON tangram.XPC_Software_MasterList_Combined.Sft_Path = tangram.XPC_Software_MasterList.Sft_Path
Where (tangram.XPC_Software_MasterList_Combined.sft_filtered = 1) AND (tangram.XPC_Software_MasterList.Sft_Filtered IS NULL OR
tangram.XPC_Software_MasterList.Sft_Filtered = 0)
This trigger does work but I would like to see if someone can provide some direction with the following questions:
1) I only want this trigger to apply if the Sft_Filtered column is changed and no other column in the table.
2) I only want this trigger to apply for the current record that is changed.
Any ideas would be appreciated....
CREATE Trigger ti_Filtered on tangram.XPC_Software_MasterList_Combined
FOR Insert, Update
AS
Update XPC_Software_MasterList
Set XPC_Software_MasterList.Sft_Filtered = 1
From tangram.XPC_Software_MasterList_Combined INNER JOIN
tangram.XPC_Software_MasterList ON tangram.XPC_Software_MasterList_Combined.Sft_Path = tangram.XPC_Software_MasterList.Sft_Path
Where (tangram.XPC_Software_MasterList_Combined.sft_filtered = 1) AND (tangram.XPC_Software_MasterList.Sft_Filtered IS NULL OR
tangram.XPC_Software_MasterList.Sft_Filtered = 0)
This trigger does work but I would like to see if someone can provide some direction with the following questions:
1) I only want this trigger to apply if the Sft_Filtered column is changed and no other column in the table.
2) I only want this trigger to apply for the current record that is changed.
Any ideas would be appreciated....