l have got a table populated with data.
l need to export and append the contents of the table to an existing table.
l have got an auto_increment column which l need to change so it starts at 100 not one

Recommended Answers

All 3 Replies

set auto index for your new table using following query

ALTER TABLE tbl AUTO_INCREMENT = 100;

Thanx but l am looking for a way to iterate iver existing records changing the id for every record

insert into desttable (idcol,col2,col3) select idcol+100, col2, col3 from sourcetable
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.