开发者

mysql: inserting data and autoincrement

i am converting from access to mysql

i have a table in access where one of the columns is an autonumber

when i transfer the data into the mysql database (where i also have a column that is auto_increment), should i be transfering the auto_increment data into the auto_increment column, or will it auto_increment itself?

开发者_运维问答how do i ensure that if i do not transfer the autoincrement data from access, that it auto_increments properly?


If you don't want to retain the autoincremented number, simply don't insert into that field. It will increment itself.

But in all likelihood you'd want to keep it (if it wasn't being used, why is it there?), and with MySQL (unlike some other systems like SQL Server) you can insert values into autoincrement columns without having to set any options to enable doing so.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜