开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜