I have two tables
table1 has three columns (id int ,book varchar(20),qua ntity 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
the query got executed by the table1 is not updated by -1.
what is the problem that is encountered here.
thanks in advance.
Raghul
table1 has three columns (id int ,book varchar(20),qua ntity 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
Code:
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
Comment