copy data from Table A to Table B

  • using MSDE so can't use DTS package builder

    I need to copy data from TableA on database X to TableB on database Y

    i have set the IDENTITY_INSERT to ON

    but the query pane does not like the following so what are you supposed to do? ... probably an easy answer...

    SET IDENTITY_INSERT ON

    INSERT INTO Y.dbo.TableB SELECT * FROM X.dbo.TableA

    SET IDENTITY_INSERT OFF

  • You're not allowed to use 'select *' with identity_insert, you must explicitly list all columns involved.

    insert newTable (identcol, othercol)

    select identcol, othercol from oldTable

     

    /Kenneth

  • thanks, spot on!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply