Link to home
Start Free TrialLog in
Avatar of SETP
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
Avatar of DotNetLover_Baan
DotNetLover_Baan

I don't think it is possible without explicitely mentionung the columne names.

-Baan
ASKER CERTIFIED SOLUTION
Avatar of smoee
smoee

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SETP

ASKER

Brilliant idea!!!