Results 1 to 4 of 4

Thread: T-SQL increment

  1. #1
    Join Date
    Apr 2004
    Location
    Melbourne
    Posts
    144

    Unanswered: T-SQL increment

    i have got 22,000 rows in a table, i want to update the records to have to start id of 70000 which increments to 70001, 70002 ? how would i go about doing this ?

  2. #2
    Join Date
    Sep 2005
    Posts
    161
    DBCC CHECKIDENT ('table_name', RESEED, 70000)

    That will set the next identity value to 70000. That should get you started. You have a couple of options from there. Come back if you need more help.

    Bill
    Last edited by cascred; 10-11-05 at 22:36.

  3. #3
    Join Date
    Apr 2004
    Location
    Melbourne
    Posts
    144
    Thanks.
    i actually DTS the data out into temp table and went into enabled the identity on the column to start at 70000. Does this DBCC reseed only existing columns where the identity option has been specified ?

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    You can only have one identity column per table. The DBCC command will reseed the counter, but it does not change existing values.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

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