Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9002191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:32:14+00:00 2026-06-16T00:32:14+00:00

I have a scenario where i need to synchronize two tables in SSIS Table

  • 0

I have a scenario where i need to synchronize two tables in SSIS

Table A is in DATABASE A and TABLE B is in DATABASE B. Both tables have same schema. I need to have a SSIS package that Synchronize TABLE A with TABLE B in Such a way That

1. It inserts all the records That Exist in Table A into Table B

AND

2. Update TABLE B if Same "Key" exsit in Both but Updated records in Table A

For Example Table A and B both Contains Key = 123 both Few Columns in Table A has been Updated.

I am thinking about using Merge Joins but that helps with only insertion of New records. How i can manage to implement UPDATE thing as well

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:32:15+00:00Added an answer on June 16, 2026 at 12:32 am
    1.It inserts all the records That Exist in Table A into Table B 
    

    Use a lookup transformation .Source will be Table A and Lookup will be Table B .Map the common columns in both the table and select those columns which you need for insertion.After lookup use OLEDB destination and the map the columns coming from the lookup and insert it into Table B

    2.Update TABLE B if Same "Key" exsit in Both but Updated records in Table A
    

    Same logic as above .Use lookup and instead of OLEDB Destination use OLEDB Command and then write the update sql .

    Update TableB
    Set col1=?,col2=?....
    

    In the column mapping map the columns coming out of the lookup

    Check out this article
    Checking to see if a record exists and if so update else insert

    Using Merge :

    MERGE TableB b
    USING TableA a
    ON b.Key = a.Key
    WHEN MATCHED AND b.Col1<>a.Col1 THEN
    UPDATE
    SET b.Col1 =  a.Col1 
    WHEN NOT MATCHED BY TARGET THEN
    INSERT (Col1, Col2, col3)
    VALUES (a.Col1, a.Col2,a.Col3);
    

    You can execute the Merge SQL in Execute SQL Task in Control Flow

    Update : The Lookup transformation tries to perform an equi-join between values in the transformation input and values in the reference dataset.

    You can just need to have one Data Flow Task .

    Diagram

    enter image description here

    When the target table data does not have a matching value in the source table then lookup will redirect the target rows to the oledb destination which inserts the Data into source table( Lookup No Match Output)

    When the target table rows matches for the business key with the source table then matched rows will be sent to the Oledb Command and using the Update SQL ,the all the target rows from the lookup will be updated in the source table .

    This is just an overview .There is a problem with the above design as when the rows matches irrespective of any change in the columns the source table will be updated .So kindly refer the above article or try for search for SCD component in ssis

    Update 2:
    
    MERGE TableB b
    USING TableA a
    ON b.Key = a.Key
    WHEN MATCHED  THEN
    UPDATE
    SET b.Col1 =  a.Col1 
    WHEN NOT MATCHED BY TARGET AND a.IsReady=1 THEN  --isReady bit data type
    INSERT (Col1, Col2, col3)
    VALUES (a.Col1, a.Col2,a.Col3);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a scenario where I need to join two SQL tables and am
I have a scenario where I need to load properties from database or java
I have kind of a such scenario: (source: microsoft.com ) Here i need to
I have a scenario where I need to bind two properties from one class
I have a scenario where I need to pull approximately 7500 database records where
I have a scenario where I need to convert columns of table to rows
I have a scenario where I have two Nhibernate SessionFactorys I need to register
I have this scenario where I need data integrity in the physical database. For
I have scenario where I need to host a web service (WCF) on Azure
I have one scenario where I need to select all files having aliencoders.numeric-digits like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.