Page 1 of 1

Database auto-increment ID (set incrementation values)

Posted: Tue Jun 24, 2003 10:31 am
by kendall
Hello,

In an Access database you are able to alter the way Primary keys auto-increment values thus instead of starting at 1 you can start at 5746. Can this affect be achieved in MySQL?
what if i wanted to affix a alpha character at the beginning of each auto-incremented value?

Kendall

Posted: Tue Jun 24, 2003 10:51 am
by twigletmac
You can't put an alpha character in front of an auto-increment value (when you display it on a web page you could add it then though). You can change what number it starts from:

Code: Select all

ALTER TABLE tbl_name AUTO_INCREMENT = 1000
That code was from the user notes on:
http://www.mysql.com/doc/en/example-AUTO_INCREMENT.html

Mac