Hello,
I created the following trigger in oracle now i want to convert this trigger for MS-sql Server.. Please help needed for converting the foloowing trigger for ms-sql databse.


CREATE OR REPLACE TRIGGER negtwo_record AFTER UPDATE ON twdbs.transactions
REFERENCING NEW AS NEW OLD AS OLD FOR EACH ROW
declare
t_negtwo_date date;

begin
--as each update is applied, if the pmflag is set to -2, record a copy of that record out to the table_negtwo_tracking table.
select sysdate into t_negtwo_date from dual;
if :new.PMFLAG = '-2' then
begin
insert into table_negtwo_tracking (TRANS_ID, EMP_ID, TRANS_DATE, ACTIVITY_ID, RESOURCE_ID, TRANS_TYPE, PMFLAG, NEGTWO_DATE)
values (:new.TRANS_ID, :new.EMP_ID, :new.TRANS_DATE, :new.ACTIVITY_ID, :new.RESOURCE_ID, :new.TRANS_TYPE, :new.PMFLAG, t_negtwo_date);
end;
else
null;
end if;
end;


Thanks,

Prashant Dalal