Welcome to WebmasterWorld Guest from 54.160.163.163

Forum Moderators: open

Message Too Old, No Replies

My trigger is stuck

I don't know how to make the comparison work

     

Baruch Menachem

2:24 am on Dec 5, 2010 (gmt 0)

5+ Year Member



I want to check the quantity of a good before we ship with a trigger that will fire a message that there isn't enough stuff if the quantity purchased is more than the inventory.

So here is a trigger on the inventory table.

for some reason, it won't recognize my table correctly.

In my stockqty is a valid field in inventory.
reate trigger InventoryUpdateTriggerTRG on inventory
for update
as
declare
@myInventoryID as integer,
@myQTY as integer;
begin
if update (stockqty)
begin
if inserted.stockqty<0
begin
rollback transaction
print ' not enough goodies to go around.'
print ' We might want to re order'
end
end
end
 

Featured Threads

Hot Threads This Week

Hot Threads This Month