CREATE trigger [dbo].[AfterInsert_WCData]
on [dbo].[TBL_WAGEDATA]
AFTER INSERT
as
declare @state char(10),
@code int,
@annualpayroll real,
@nofemp int,
@wagedataid int,
@pid int,
@sutalimit real,
@ficarate real,
@futarate real,
@futacost real,
@sutarate real
select @state=i.State,
@pid = i.PID,
@code = i.Class,
@annualpayroll = i.AnnualPayroll,
@nofemp = i.EE,
@wagedataid = i.WageDataId from TBL_WAGEDATA i;
select @sutalimit = r.Limits,
@ficarate = r.Fica_Rate,
@futarate = r.Futa_Rate,
@futacost = r.Futa_Cost,
@sutarate = r.Suta_Rate
from TBL_ALL_RATES r where @state=r.State
insert into TBL_RFQ_DATAS values
(@state,
@code,
@annualpayroll,
@sutalimit,
@nofemp,
@ficarate,
'0',
@futarate,
@futacost,
@sutarate,@sutarate,@sutarate,'0','0',0,'0','0','0','0','0','0',@pid,@wagedataid,1)
on [dbo].[TBL_WAGEDATA]
AFTER INSERT
as
declare @state char(10),
@code int,
@annualpayroll real,
@nofemp int,
@wagedataid int,
@pid int,
@sutalimit real,
@ficarate real,
@futarate real,
@futacost real,
@sutarate real
select @state=i.State,
@pid = i.PID,
@code = i.Class,
@annualpayroll = i.AnnualPayroll,
@nofemp = i.EE,
@wagedataid = i.WageDataId from TBL_WAGEDATA i;
select @sutalimit = r.Limits,
@ficarate = r.Fica_Rate,
@futarate = r.Futa_Rate,
@futacost = r.Futa_Cost,
@sutarate = r.Suta_Rate
from TBL_ALL_RATES r where @state=r.State
insert into TBL_RFQ_DATAS values
(@state,
@code,
@annualpayroll,
@sutalimit,
@nofemp,
@ficarate,
'0',
@futarate,
@futacost,
@sutarate,@sutarate,@sutarate,'0','0',0,'0','0','0','0','0','0',@pid,@wagedataid,1)
No comments:
Post a Comment