Insert Latest Record

jn93 671 Reputation points
2022-10-14T03:12:16.16+00:00

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.

250291-image.png

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

1 answer

Sort by: Most helpful
  1. ZoeHui-MSFT 36,511 Reputation points
    2022-10-14T06:15:17.053+00:00

    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.

    250284-image.png

    If I misunderstand your issue, please incorrect me.

    Regards,

    Zoe Hui


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


Your answer

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