Insert Latest Record

jn93 651 Reputation points

Hi, I have SSIS fetching the record from text file and go to the sql database table. Lets say I check CURVEHNO for match and no match record, but there is REQTIMESTAMP for each record. For match record, I have no problem since I will sort the REQTIMESTAMP in desc order and during update it will fetch the first row with the latest record. But for the non-match record, how can I insert the latest record? Please refer the diagram below with the example. Thanks and Regards.


SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,467 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ZoeHui-MSFT 33,626 Reputation points

    Hi @jn93

    What about adding the sort component before the row count int?

    You may sort with the REQTIMESTAMP in desc order and then load to the Main table.


    If I misunderstand your issue, please incorrect me.


    Zoe Hui

    If the answer is helpful, please click "Accept Answer" and upvote it.