Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2003
    Location
    germany
    Posts
    17

    Unanswered: reset auto-increment field (primary key)

    hi,

    i have a table with a field that is both primary key and
    auto-increment (generated always). now i have to
    reset the value of that field to 1. does anyone how
    that works. sql command (update ...) fails (for sure).

    thanks
    chris

  2. #2
    Join Date
    Jan 2003
    Posts
    24
    You can probably use "ALTER TABLE <table> ALTER COLUMN <column> RESTART WITH 1"

    Regards
    /Daniel

  3. #3
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: reset auto-increment field (primary key)

    Check the alter table syntax ...

    Cheers

    Sathyaram

    Originally posted by chrste
    hi,

    i have a table with a field that is both primary key and
    auto-increment (generated always). now i have to
    reset the value of that field to 1. does anyone how
    that works. sql command (update ...) fails (for sure).

    thanks
    chris

  4. #4
    Join Date
    Mar 2003
    Location
    germany
    Posts
    17
    That works !
    thanks a lot
    chris


    Originally posted by dbl
    You can probably use "ALTER TABLE <table> ALTER COLUMN <column> RESTART WITH 1"

    Regards
    /Daniel

Posting Permissions

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