SETP
asked on
SQL Query
I have an SQL query that copies some rows from one table to another table with identical structure:
INSERT INTO Table1 SELECT * FROM Table2 WHERE ID > 10
The only problem is that it complains about a concurrency issue. The problem is that the ID column is an AutoNumber column, so when it tries to copy the row(s) from the one table to the other, the ID field gets a duplicate value which is not allowed. Is there any way round this without having to specifically type out all the column names minus the ID field? The reason I ask is cause the table could be any of 15 different tables with an average of 15 columns each!!!!!
Thanks
INSERT INTO Table1 SELECT * FROM Table2 WHERE ID > 10
The only problem is that it complains about a concurrency issue. The problem is that the ID column is an AutoNumber column, so when it tries to copy the row(s) from the one table to the other, the ID field gets a duplicate value which is not allowed. Is there any way round this without having to specifically type out all the column names minus the ID field? The reason I ask is cause the table could be any of 15 different tables with an average of 15 columns each!!!!!
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Brilliant idea!!!
-Baan