Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2004
    Posts
    2

    Arrow Unanswered: How to get generated identity value?

    Hi,

    How can I retrieve generated identity value after insert a row into table in case I can identify inserted row?

    (the INSERT statement is dynamic constructed and queried from data access layer, not in stored procedure)

    Thanks,

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    In the same batch, you can use @@identity or scope_identity(). Once you allow the batch to end, it gets a lot trickier to get the identity value back.

    -PatP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •