I want to copy 1 row from Table A
to Table A2
.
Here is my code:
Insert into A2
select * from A1
where ID=290
Id
is a Primary Key
and both tables have same structure.
Obviously the above code failed because it cannot insert the Primary Key
(And I don't want it to, I want a new PK
be generated).
I know I can use explicit insert but this is a very wide table with hundreds of columns.
Is there any way to insert every column expect ID
which is the Primary Key
?
NO: this is NOT the solution. Please spend 1 minute time and read question Carefully before closing them!
I said I know this is possible with explicit insert . I want to know if can done with shorter SQL since this is a VERY wide table.
If you have the solution please mention the reference here.