Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with trigger code follows:

Status
Not open for further replies.

DWag

IS-IT--Management
Jan 28, 2003
25
US
Switching database formats and all existing triggers are being rewritten in sql. The following uses only one table and needs to look for the first match based on the first nine digits of item and then update certain fields in the new item created....


CREATE TRIGGER boardsize ON item
FOR INSERT
as

update itm

set itm.uf_cswidth = i.uf_cswidth

from item itm

join ( select distinct substring(item,1,9) from item where item.product_code like 'lam%' ) i
on substring(itm.item,1,9) = substring(i.item,1,9)


Thanks
Dedra
 
Do you know about the meta-tables Inserted, Updated, and Deleted?

-------------------------------------
There are 10 kinds of people in the world: those who know binary, and those who don't.
 
No, fairly new to the sql language. Have the basics but still lacking ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top