table1 has three columns (id int ,book varchar(20),quantity int)
table2 has two columns (id int,book varchar(20))
now if I insert a row in table2 then the quantity of the particular id has to be reduced by 1.
I tried my query as
Expand|Select|Wrap|Line Numbers
- create trigger ins_trigger on table2
- after insert as
- declare @id int
- update table1 set quantity=quantity-1 where id=@id
what is the problem that is encountered here.
thanks in advance.
Raghul