Trigger Update Current Record Only

Nov 20, 2005 4 Replies

I have written a trigger that updates prices based on changes to subdescription3. The trigger works but it updates all records that meet the conditions. I only want to update the current record to improve processing time. How do I tell the trigger that I only want it to process the current item id?


join to the "inserted" table in an Update or Insert trigger. See SQL Server books online or MSDN.

Dave,

If i is table Item then you need to use i.ID not i.ItemID

Rob

The "inserted" table uses the same schema as the table the trigger is attached to. So if your trigger is for an Update of the Item Table, you would need to use the ID field as Rob said.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required