Get last row inserted
I have a trigger that inserts a record into a diff table but I need to get that record that was inserted inside the trigger, how do I do it? There is no identity开发者_高级运维 field, only account_nbr that is generated by a separate trigger on the insert table.
I don't know if there is sql statements to retrieve a row that was just inserted.
DB is Sql Server 2008.
The OUTPUT clause will give you back the records you have just inserted: http://msdn.microsoft.com/en-us/library/ms177564.aspx
If you mean the rows inserted before the trigger invoked, they are in the inserted
pseudo-table.
精彩评论