Keep Identity values when importing data from one sql server table to another

  • I use the identity insert on value when importing data from multiple tables. But when I look at the data it's importing it is not keeping the identity field values. If I only import one table at a time it works but If I try importing multiple tables it doesn't.

    Any one else had this problem?

  • Are you using SET IDENTITY_INSERT ON for each table? Only one table at a time can have it on.

    Greg

  • Yes. So you can only import one table at a time with Identity insert on? So If I need to import 50 tables I have to do each of them individually.

  • You have to turn identity insert on and off as each table is loaded. Of course that will slow you down because you will only be able to load one table at a time.

    Have you considered taking a backup of server and and restoring to server b? That might be useful if server a contains only the data you want on server b.

    Marvin Dillard
    Senior Consultant
    Claraview Inc

  • You can still import all the tables in a single package with precedent constraints controlling flow between data flow tasks and it will still be pretty fast.

    Greg

Viewing 5 posts - 1 through 4 (of 4 total)

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