Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2004
    Posts
    16

    Unanswered: default value for autoincrement primary key

    Hello,

    I am trying to set up a table where the default value for the primary key starts @ 101 and auto increments from there.

    I've had no luck so far. Is this possible?

    -Clem C

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    See SET INSERT_ID for details.

    -PatP

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    or

    CREATE TABLE foo ( column definitions ) AUTO_INCREMENT=101
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote Originally Posted by r937
    CREATE TABLE foo ( column definitions ) AUTO_INCREMENT=101
    I never realized you could do that! I learned something, now I can go home.

    -PatP

Posting Permissions

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