views:

43

answers:

1

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?

+1  A: 

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.

Daniel DiPaolo
You can insert values into SQL Server for things like data imports when you have an identity column. I do it all the time when moving large anmounts of legacy data.
HLGEM
You can, but you have to set `IDENTITY_INSERT`. I meant without setting any options, so I've updated the post to clarify.
Daniel DiPaolo