SSIS: Handling Identity Mapping When Migrating Data Between Databases

Benjamin Heredia 20 Reputation points
2025-10-07T06:10:11.36+00:00

Hi,

I’m new to SSIS and have been assigned to migrate data from an old database (v1) to a newer one (v2). The newer database already contains data, and its tables use identity columns as primary keys.

The challenge is that there are multiple tables related by foreign keys to one master table. I plan to start with the master table — inserting records from the old master table into the new one. This will generate new identity values, which I then need to apply to the dependent (child) tables so that relationships remain consistent.

I was instructed to use minimal T-SQL and rely primarily on SSIS tools/components. However, so far, the only approach I’ve found is to:

Insert data into the new master table using a SQL query.

Capture the generated identity values along with their corresponding old IDs.

Store this mapping in a temporary or staging table for use when migrating related tables.

Is there a way to handle this mapping or identity synchronization purely using SSIS components, or at least with minimal SQL scripting?

Any guidance, best practices, or examples would be greatly appreciated.

Thank you!

SQL Server Integration Services
0 comments No comments
{count} votes

Answer accepted by question author
  1. Akhil Gajavelly 645 Reputation points Microsoft External Staff Moderator
    2025-10-07T09:32:40.6133333+00:00

    Hi @Benjamin Heredia,

    Use one INSERT ... OUTPUT to create the ID mapping, then use SSIS Lookup transformations for all child table migrations. This approach is proven in production and requires minimal SQL scripting

    Thanks,
    Akhil.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.