sql server management studio set
create trigger ins_compra (u otro)on compras (u otro)
for insert
as
declare @cant (u otro) as int
declare @codigo (u otro) as varchar (6)
set @cant (u otro) =(select cant (u otro) from inserted)
set @codigo (u otro) =(select codarticulo (u otro) from inserted)