homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

My trigger is stuck
I don't know how to make the comparison work
Baruch Menachem

5+ Year Member

Msg#: 4238806 posted 2:24 am on Dec 5, 2010 (gmt 0)

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
@myInventoryID as integer,
@myQTY as integer;
if update (stockqty)
if inserted.stockqty<0
rollback transaction
print ' not enough goodies to go around.'
print ' We might want to re order'


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved