Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2001
    Posts
    2

    Arrow Unanswered: Reset The Auto Generated Numbers

    How can I reset an auto generated number back to start from 1 again.
    I made a test table, now to implement the table I need to start the counter back from 1.

    The field that I am trying to reset is CustID
    It is a primary key for a table and it is set as an Indentity with Increment 1.

    Thanks
    Taimur

  2. #2
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    809
    "Truncate table" will reset the identity counter to the original seed value.
    Paul Young
    (Knowledge is power! Get some!)

  3. #3
    Join Date
    May 2002
    Posts
    10
    or you could use the following (where TestTable is the name of the table):

    DBCC CHECKIDENT (jobs, TestTable, 1)

  4. #4
    Join Date
    May 2002
    Posts
    10
    Sorry... just to correct the previous posting:

    DBCC CHECKIDENT (TestTable, RESEED, 1)

  5. #5
    Join Date
    Aug 2001
    Posts
    2

    Talking Thanks

    Thanks Iwaker. This worked perfect.

    Originally posted by lwaker
    Sorry... just to correct the previous posting:

    DBCC CHECKIDENT (TestTable, RESEED, 1)

Posting Permissions

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