Deadlock by getting SCOPE_IDENTITY()

  • Hi,

    I need a unique value for a composite key. I have created a little table that has an IDENTITY column. I inserts a record via StoredProc., And get as output parameters the SCOPE_IDENTITY ().

    In a BulkInsert from a flat file, sometimes it comes at a high load to a DEADLOCK on this place....the procedure continues to run without having the key :w00t:

    Is there a better method to get a UniqueKey quickly?

    BestReagards

    Nicole

    😎

  • Can you try by replacing SCOPE_IDENTITY() with @@IDENTITY?

    SCOPE_IDENTITY() returns the current identity withing the current scope, while @@IDENTITY is not scope limited.

    Regards,

    IgorMi

    Igor Micev,
    My blog: www.igormicev.com

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

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