Getting Last inserted row in a table

  • Hi,

    I'm looking for a way to be able to retrieve the last inserted row in an already existing table. I'm trying to find something that could be similar to ora_rowscn on Oracle Database.

    Is it possible to do that on MS SQL Server without having to modify the structure of the table?

    Thanks

  • Without some column that indicates the order of rows inserted (identity, datetime default getdate()), no.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply