Copy Table with Identity field between 2 DataWarehouses RRS feed

  • Question

  • Hello,

    We need to copy several tables with identity fields, but we can't change the values. These fields are used as referential keys in quite some other tables. Normally one can do that with a 

    TRUNCATE TABLE [ods_tr_energy_xmlin].[EVN_Logging];
    SET IDENTITY_INSERT [ods_tr_energy_xmlin].[EVN_Logging] ON

    Then insert the records, but it back to OFF and reset the Identity field with a DBCC.

    But then placing the SET IDENTITY INSERT in the pre-copy script doesn't work.

    Anybody has an idea on how we could manage ?

    Friday, March 1, 2019 8:23 AM