SSIS lookup match output to temporary table (2023)

Ask a question

Find related threads

  • Remove from my forums

Answered by:

Archived Forums 361-380

>

SQL Server Integration Services

  • Questions

  • SSIS lookup match output to temporary table (1)

    Sign in to vote

    Hello experts,
    I am working on SSIS 2008,
    The SQL table is the source and destination.
    The task is to load data from the source to the destination, if it matches, update the destination table and no match, then insert into the destination table.

    I took the OLEDB source which refers to the source table,
    - Storage, destination table Conatin..
    -If the lookup data does not match "DO NOT MATCH", I insert it into the destination table

    my demand: IF it matches, I will insert these entries into the TEMP table.

    I know we can use ##TEMP table in SSIS,
    Make sure to keep the same connection property on TRUE
    and Delay Validation TRUE..

    But how could I insert MATCH data coming from LOOKUP into table ##Temp,
    What approach and transformation should I use?


    SSIS lookup match output to temporary table (3)
    The above approach doesn't work because I can't see the temp table to load MatchData? Also above this DataFlow I taskI have created the Execute SQL task to create a table ##temp.. HELP?

    • Edited by Rihan8585 Friday 1 November 2013 at 06.25

    Friday, November 1, 2013 06:14

Answer

  • SSIS lookup match output to temporary table (4)

    Sign in to vote

    I want to update the match data in the destination table and insert data that does not match.
    A few days ago I read an article aboutWWW.SQLservercentral.comdvs

    http://www.sqlservercentral.com/articles/Integration+Services+(SSIS)/102924/
    SEE Option 3 (INSERT THEN UPDATE)


    Where you requested to load match data into temp table and then use temp table to update target table match data...(Performance will be faster compared to OLEDB command.)
    I don't want to use the OLEDB command because the performance is worse and I have approx. 46 million rows coming from the source.

    

    NOTE: I can't create \ am not allowed to create a temp \ fitness table, I want to use the temp ## table so as not to increase the number of tables in my database.

    Since the source data has 46 million records and I'm assuming the same large number will be in the destination table to lookup, this approach won't be efficient. I would suggest the following:

    1. load the source data into the raw/stage table.
    2. use the T-SQL MERGE statement to upsert between the final destination table and the raw/staging table.

    Tak, hsbal

    • Marked as answer by mike yin Sunday, November 17, 2013 1:53 PM

    Tuesday, November 5, 2013 4:28 PM

  • POINT 2)
    I can't use t-sql MERGE statement because my source and destination table are in different databases and I don't want to HARDCODE the database name with the table name in T-sql Merge, that's why I'm looking for an SSIS solution.

    Why don't you want to use the database name in the 2 part naming? This is absolutely correct and can be done.

    ENT 1)
    USE RAW\STAGING TABLE: This is my question, how to create a temporary table to load MATCH data coming from SEARCH? So I can use this temporary table to UPDATE THE MATCH DATA in the DESTINATION TABLE.

    I said this may not be efficient because the Find component will have to store all the target records in memory and then identify the delta. This step will be less efficient if the destination table has millions of rcds and LOOK Up is not worth using for me.

    Tak, hsbal

    • Marked as answer by mike yin Sunday, November 17, 2013 1:53 PM

    Thursday 7 November 2013 at 20.05

All the answers

  • SSIS lookup match output to temporary table (8)

    Sign in to vote

    Hola

    in the ssis package you have 2

    1-you can use recordset.

    RecordSet should use variable and

    The variable will be a data type object.

    2- you can use Raw File Destination.

    Friday November 1, 2013 at 09:36

  • SSIS lookup match output to temporary table (10)

    Sign in to vote

    Could you explain it more? or another solution to this?

    Tuesday 5 November 2013 at 06.02

  • SSIS lookup match output to temporary table (12)

    Sign in to vote

    Hi Rihan,

    from my understanding you have to create the temp table structure first, then you have to load data into the temp table.

    Please try the link below, it might fix the error you are getting.

    http://stackoverflow.com/questions/5631010/how-to-create-a-temporary-table-in-ssis-control-flow-task-and-then-use-it-in-dat

    o

    http://sqlscrapbook.wordpress.com/2010/07/14/load-data-into-a-temp-table-using-ssis/

    So,

    Anil Kumar

    Tuesday 5 November 2013 at 08.08

  • Hello Anil,
    Thanks for the reply..

    If you go through my entire thread, I already mentioned that I took the Execute SQL task to create the temporary table and set the required properties like "Keep same connection" and "Delay validation".
    Althoughafter creating temp table ## in EExcute SQL task before data flow taskCan't see temp table ## for LOAD MATCH The data in the temp table came from LOOKUP.
    IMAGE is only to give the idea of ​​requirement..
    Some help?

    Tuesday, November 5, 2013 08:47

  • SSIS lookup match output to temporary table (16)

    Sign in to vote

    May I ask the reason for the temp table? What will you use the data in this temporary table for?

    Tuesday 5 November 2013 at 09.08

  • SSIS lookup match output to temporary table (18)

    Sign in to vote

    I want to update the match data in the destination table and insert data that does not match.
    A few days ago I read an article aboutWWW.SQLservercentral.comdvs

    http://www.sqlservercentral.com/articles/Integration+Services+(SSIS)/102924/

    SEE Option 3 (INSERT THEN UPDATE)


    Where you requested to load match data into temp table and then use temp table to update target table match data...(Performance will be faster compared to OLEDB command.)
    I don't want to use the OLEDB command because the performance is worse and I have approx. 46 million rows coming from the source.

    

    NOTE: I can't create \ am not allowed to create a temp \ fitness table, I want to use the temp ## table so as not to increase the number of tables in my database.

    • Edited by Rihan8585 Tuesday 5 November 2013 at 09.55

    Tuesday, November 5, 2013 09:52

  • SSIS lookup match output to temporary table (20)

    Sign in to vote

    Have you considered using a Raw file as the destination?

    Tuesday 5 November 2013 16:15

  • SSIS lookup match output to temporary table (22)

    Sign in to vote

    I want to update the match data in the destination table and insert data that does not match.
    A few days ago I read an article aboutWWW.SQLservercentral.comdvs

    http://www.sqlservercentral.com/articles/Integration+Services+(SSIS)/102924/
    SEE Option 3 (INSERT THEN UPDATE)


    Where you requested to load match data into temp table and then use temp table to update target table match data...(Performance will be faster compared to OLEDB command.)
    I don't want to use the OLEDB command because the performance is worse and I have approx. 46 million rows coming from the source.

    

    NOTE: I can't create \ am not allowed to create a temp \ fitness table, I want to use the temp ## table so as not to increase the number of tables in my database.

    Since the source data has 46 million records and I'm assuming the same large number will be in the destination table to lookup, this approach won't be efficient. I would suggest the following:

    1. load the source data into the raw/stage table.
    2. use the T-SQL MERGE statement to upsert between the final destination table and the raw/staging table.

    Tak, hsbal

    • Marked as answer by mike yin Sunday, November 17, 2013 1:53 PM

    Tuesday, November 5, 2013 4:28 PM

  • SSIS lookup match output to temporary table (24)

    Sign in to vote

    Another problem you will run into when using a destination table is that lookups are deadlocks, this is especially true for large data sets. It would create a lookup cache in memory of the target instead of doing a direct lookup in the table.

    Tuesday, November 5, 2013 4:38 PM

  • SSIS lookup match output to temporary table (26)

    Sign in to vote

    Since the source data has 46 million records and I'm assuming the same large number will be in the destination table to lookup, this approach won't be efficient. I would suggest the following:

    1. load the source data into the raw/stage table.
    2. use the T-SQL MERGE statement to upsert between the final destination table and the raw/staging table.

    Tak, hsbal

    Hello, Harry,
    thanks for the reply
    POINT 1)
    USE RAW\STAGING TABLE: This is my question, how to create a temporary table to load MATCH data coming from SEARCH? So I can use this temporary table to UPDATE THE MATCH DATA in the DESTINATION TABLE.

    POINT 2)
    I can't use t-sql MERGE statement because my source and destination table are in different databases and I don't want to HARDCODE the database name with the table name in T-sql Merge, that's why I'm looking for an SSIS solution.

    Wednesday 6 November 2013 at 06.27

  • SSIS lookup match output to temporary table (28)

    Sign in to vote

    POINT 2)
    I can't use t-sql MERGE statement because my source and destination table are in different databases and I don't want to HARDCODE the database name with the table name in T-sql Merge, that's why I'm looking for an SSIS solution.

    Why don't you want to use the database name in the 2 part naming? This is absolutely correct and can be done.

    ENT 1)
    USE RAW\STAGING TABLE: This is my question, how to create a temporary table to load MATCH data coming from SEARCH? So I can use this temporary table to UPDATE THE MATCH DATA in the DESTINATION TABLE.

    I said this may not be efficient because the Find component will have to store all the target records in memory and then identify the delta. This step will be less efficient if the destination table has millions of rcds and LOOK Up is not worth using for me.

    Tak, hsbal

    • Marked as answer by mike yin Sunday, November 17, 2013 1:53 PM

    Thursday 7 November 2013 at 20.05

  • SSIS lookup match output to temporary table (30)

    Sign in to vote

    I have exactly the same question and no one has given a direct answer to this:\ - how to transport match data to a temp table using dest OLEDB...

    Tuesday February 27, 2018 at 11:08

Top Articles
Latest Posts
Article information

Author: Neely Ledner

Last Updated: 07/08/2023

Views: 6239

Rating: 4.1 / 5 (62 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Neely Ledner

Birthday: 1998-06-09

Address: 443 Barrows Terrace, New Jodyberg, CO 57462-5329

Phone: +2433516856029

Job: Central Legal Facilitator

Hobby: Backpacking, Jogging, Magic, Driving, Macrame, Embroidery, Foraging

Introduction: My name is Neely Ledner, I am a bright, determined, beautiful, adventurous, adventurous, spotless, calm person who loves writing and wants to share my knowledge and understanding with you.