Identity value from last insert from Linked server

Discussion in 'Databases' started by urstop, Oct 6, 2009.

  1. #1
    I am working on a SQL Server based ASP.NET app that is inserting some data to a linked server thru this SQL Server.

    I would like to get the last inserted identity value from that linked server.

    Since, none of the functions like identity,scope_identity etc do not work for linked servers AND also, I can't just relay on the MAX function as the database is highly transactional.

    Also, to add, I do not have rights to create any new SPs or functions on the linked server either.

    So is there any other way to get this information.
     
    Last edited: Oct 6, 2009
    urstop, Oct 6, 2009 IP
  2. rayqsl

    rayqsl Active Member

    Messages:
    91
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    53
    #2
    I haven't used linked servers so cam only guessing at the following.

    If the row that you've inserted is unique then you could just do a select on the table because you know what the "key" column values are.

    If it's not unique then I don't know.
     
    rayqsl, Oct 8, 2009 IP