As far as I understand, the problem is that you want to insert INSERT into table A, in which there is an identity column, and you want to keep the identity from table B, which is not.
To do this, you just need to enable the identity insert in table A. This will allow you to define your identifier for the insert, and as long as they do not conflict, you should be fine. Then you can simply do:
Insert into A(identity, fname, lname) SELECT newid, fname, lname FROM B
You do not know which database you are using, but for the sql server the command to enable the insert of identifier is:
set identity_insert A on
Cory Sep 18 '08 at 19:32 2008-09-18 19:32
source share