Results 1 to 4 of 4

Thread: Primary Key question

  1. #1
    Join Date
    Mar 2004
    Posts
    11

    Primary Key question

    Hello All,

    Here is an easy one, not for me though, that I hope you can answer.

    I have a table with a integer primary-key and the way that it is working now, it starts off at 1 and adds 1 each time a new entry is added to the table. The standard method I think.

    What I need to do is to empty the table and have the primary-key start off a say 1000 or 5000.

    How can I set a default value for the Primary-Key to start out at?

    Thanks,
    Lonnie

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    If it's identity column, you can reseed it with 'dbcc checkident'.

  3. #3
    Join Date
    Mar 2004
    Posts
    11
    Hello,

    I looked at 'DBCC CHECKIDENT ' and it looks like it could be part of the solution.

    The remaining part would be for me to:

    1.) Not loose the existing data in the table.

    2.) renumber the existing primary-key values starting from some initial RESEED value.

    How about this?

    Thanks,
    Lonnie

  4. #4
    Join Date
    Sep 2002
    Posts
    5,938
    Copy the table to testing server and do the test on it.

Posting Permissions

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