how to detect instigating record from within a trigger

I am using a trigger in SQL Server 2005. The Trigger is initiated AFTER UPDATE each time a record in the specified database table is made.
I wish to know how I can identify the specific record in the table that was modified and resulted in the initiation of the trigger ?.

LVL 2
alcindorAsked:
Who is Participating?
 
jorge_torizConnect With a Mentor Research & Development ManagerCommented:
I call the DELETED table as a temp table because it only lives during the trigger execution.
0
 
Neil RussellTechnical Development LeadCommented:
Have a real good read here -> http://msdn.microsoft.com/en-us/library/cc917674.aspx
Covers lots of aspects of record versioning including the use in an AFTER UPDATE stmt
0
 
jorge_torizResearch & Development ManagerCommented:
Use the UPDATED temp table, then get the values for the columns that compose your primary key to identify the row.
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
Aneesh RetnakaranDatabase AdministratorCommented:
you need to use the INSERTED and DELETED(containing new and old values of changed records respectively).
0
 
jorge_torizResearch & Development ManagerCommented:
Jejeje, yes, there was an error in my comment, the DELETED table is the name of the temp table where you can locate the modified row.
0
 
alcindorAuthor Commented:
I do not understand what you mean by the temp table referred to in your answers. The column that was modified is on no interest to me in this application, just the row (record) that was modified.

I did not have the time persue the matter during tha past 3 days, hence the lack of response.

Roger
0
 
alcindorAuthor Commented:
Thanks for the clarification, now I understand your original comments and the solution is exactly what I need.

Seasons greetings also,

Roger
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.