AUTO INCREMENT
Since the MySQL Query Browser on my Mac refused to let me set a field as auto increment through the GUI, here's how you can using SQL change an existing column to use auto_increment:
SQL:
-
ALTER TABLE `aggregatedWeekly` CHANGE `Id` `Id` INT( 6 ) UNSIGNED NOT NULL AUTO_INCREMENT
UPDATE
I have also recently found out that the following works just as well:
SQL:
ALTER TABLE `aggregatedWeekly` AUTO_INCREMENT=1
About this entry
You’re currently reading “AUTO INCREMENT,” an entry on gregs
- Published:
- Thursday, June 29th, 2006 at 12:00 am
- Author:
- gregs
- Category:
- MySQL
No comments
Jump to comment form | comments rss | trackback uri