Basically I have a trigger that is fired off whenever a workorder is reopened to close it again.
The trigger works perfectly but I want to track the workorders where there is an attempt to reopen it.
so basically if workorderid 8 is attempted to open again I want to insert this value into triggerLajob along with the date.
I cannot figure out how to pull that actual value of when the trigger is fired.
any ideas.
SQL SERVER 2005 Dev edition
ALTER TRIGGER WorkOrderClosedStatus ON Lajob
AFTER UPDATE
AS
IF UPDATE(statusid)
Update Lajob
set statusid = '39A80787-B084-DD11-9BCC-0014221E87F0'
where statusid = '38A80787-B084-DD11-9BCC-0014221E87F0'
print 'Trigger has been fired'
Insert into triggerLajob
--values I want inserted into table select workorderid , getdate()
GO