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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

update trigger

Status
Not open for further replies.

solo1234

Programmer
Jun 25, 2007
39
NL
Dear all,

How can we find out in a update trigger script which record is updated? For example which record_id?

Nice regards,
Michelle.

script:
CREATE trigger dbo.update_indicator
on dbo.Products
after update
as
print @@ROWCOUNT
 
I find it out by myself:

The changed records are temporary insert into table Inserted!

Michelle.
 
You could check which Record_Ids are in UPDATED metatable in TRIGGER.

Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
Microsoft MVP VFP
 
Remember when writing a trigger that the trigger needs to work on a set of data not a single record or it will break if someone does a mass update or insert.

"NOTHING is more important in a database than integrity." ESquared
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top