@@IDENTITY for web based applications

  • I need to create stored procedures which are used in web applications.

    While after adding master record  i need to add records to detail table. The master record created identity value which I will be using while inserting into

    detail table. I am using @@IDENTITY to catch the identity value. Is it safer one in web based applicataions or any other method is ther to avoid contention.

    Need help on this.

     

  • Use SCOPE_IDENTITY because SCOPE_IDENTITY identifies the last identity value for the current scope where as @@IDENTITY identifies the last identity regardless of scope.

  • Thanks a lot for the replay...

     

  • i use IDENT_CURRENT('table_name') because i get the last identity value generated for a specific table in any session and any scope


    Everything you can imagine is real.

Viewing 4 posts - 1 through 3 (of 3 total)

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