IDENT_CURRENT question

  • I ran some codes below.

    SELECT count(*) FROM Member // result: 1106

    select Max(ID) FROM Member // result: 1347

    SELECT IDENT_CURRENT ('Member' ) // result: 1348

    Question: before insert a record, why IDENT_CURRENT return 1348?

  • It's the last ID generated for any session in any scope. So another session may have experienced a rollback or something else that caused it to generate an identity value and then not use it. For more details, see the entry in Books Online.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

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

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