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!

Trigger on inserted or updated record only 1

Status
Not open for further replies.

thromada

MIS
May 10, 2004
30
US
Hi All,
If I use CREATE Trigger NAME On TABLE For Insert, Update
As UPDATE TABLE SET field = value FROM TABLE WHERE CONDITION... how can this type of trigger be changed to affect only the CURRENT RECORD that's being inserted or updated? I don't know how to tell the WHERE CONDITION (or any other portion) to only work with the record that's being inserted or updated.

Thanks much.
Tom.
 
Use the logical table "inserted". It holds the row currently being inserted or updated. It has the same column structure as your table. You just need to join to it.

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top