Carnation Flowers

Carnation Flowers

  • NA
  • 493
  • 35.4k

need help in trigger

Sep 2 2017 8:07 AM

down votefavorite

i create trigger to get some values and wann to insert it into table when i open thers is empty columns in table any help please??

ALTER trigger [dbo].[rptFees] on [dbo].[Sessions_]After insert

as Begin Declare @mcid int Declare @prc float set @prc=(select [perce] from [dbo].[MCpercentage] where [MCID]=@mcid) Declare @Totalapp float Declare @TotalMC float set @TotalMC=(select [TotalFees] from[dbo].[Sessions_] where MCID=@mcid) set @Totalapp=@TotalMC-(@TotalMC*(@prc/100)) Declare @TotalOfMC float set @TotalOfMC=@TotalMC-@Totalapp insert into [dbo].mcFees values (@TotalOfMC,@Totalapp,@prc,@mcid)

End


Answers (1)