blah blah blah is here! blah blah » Close

up0down
link

This is actually a SQL Server question: How can I access the newly inserted row from within an INSERT trigger?

last answered 2 years ago

1 answers

up0down
link

A newly inserted row will be in the 'inserted' table and a newly deleted row will be in the 'deleted' table.  
See: http://www.sqlteam.com/item.asp?ItemID=3850 for details

up0down
link

From Books Online:
deleted and inserted are logical (conceptual) tables. They are structurally similar to the table on which the trigger is defined, that is, the table on which the user action is attempted, and hold the old values or new values of the rows that may be changed by the user action. For example, to retrieve all values in the deleted table, use:
SELECT *
FROM deleted

up0down
link

CSF,
Do you guys use SQL Server for your database?

This post was imported from csharpfriends, if you have a similiar question please ask it again.

All previous members have been migrated, hope you enjoy the new platform!

Feedback