none
Meaning of info returned by DBCC CheckIdent

    Question

  • I ran   DBCC CheckIdent (<table>, reseed, 1000)  on a table to reseed its identity. This was returned:

    "Checking identity information: current identity value 'NULL', current column value '1000'.

    a. Current identity value 'NULL' :  I don't understand this as the current identity value of that column is set to 1000 with an increment of 1 (from SSMS)

    b. Current column value '1000':   does this mean the identity of the next record inserted will be 1000 + 1 ?

    The terminology seems confusing to me.  Any help appreciated.

    TIA,

    edm2

    Tuesday, September 24, 2013 3:43 PM

Answers

  • >>current identity value 

    This means the value that was last inserted which is nothing but the Current value of Identity that is used.

    check the message window,

    use tempdb
    
    create table test1(c1 int identity(1,1))
    
    select seed_value,increment_value,last_value, * from sys.identity_columns where object_id=object_id('test1')
    
    DBCC CheckIdent (test1, reseed, 1000) 
    
    insert into test1 default values 
    
    go
    drop table test1
    go
    create table test1(c1 int identity(1,1))
    
    select seed_value,increment_value,last_value, * from sys.identity_columns where object_id=object_id('test1')
    insert into test1 default values 
    DBCC CheckIdent (test1, reseed, 1000) 
    


    Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.

    Wednesday, September 25, 2013 2:26 AM
    Answerer

All replies

  • It means the current Identity column value will be 1000.

    Checkident is used to reseed the next value of an Identity property column.

    http://technet.microsoft.com/en-us/library/ms176057.aspx


    Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.

    • Proposed as answer by zcurtin608 Tuesday, September 24, 2013 5:01 PM
    Tuesday, September 24, 2013 4:02 PM
    Answerer
  • I understand what you wrote but the output does not make sense to me:

    >>>> "Checking identity information: current identity value 'NULL'

    That's crazy as the current identity is 1000, autoincrement 1.

    edm2

    Wednesday, September 25, 2013 12:16 AM
  • >>current identity value 

    This means the value that was last inserted which is nothing but the Current value of Identity that is used.

    check the message window,

    use tempdb
    
    create table test1(c1 int identity(1,1))
    
    select seed_value,increment_value,last_value, * from sys.identity_columns where object_id=object_id('test1')
    
    DBCC CheckIdent (test1, reseed, 1000) 
    
    insert into test1 default values 
    
    go
    drop table test1
    go
    create table test1(c1 int identity(1,1))
    
    select seed_value,increment_value,last_value, * from sys.identity_columns where object_id=object_id('test1')
    insert into test1 default values 
    DBCC CheckIdent (test1, reseed, 1000) 
    


    Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.

    Wednesday, September 25, 2013 2:26 AM
    Answerer