Incremental Loads in SSIS are often used to keep data between two systems in sync with one another. They are used in cases when source data is being loaded into the destination on a repeating basis, such as every night or throughout the day
Below we have a
ll the steps are done in the SQL Server Integration Service (SSIS).
We don’t used the Lookup function because, while working
with the large amount of records you must take care of the SSIS performance.
Lookup will fetch all the records and then it will compare to your condition.
But in this solution, we had considered only those records which was the latest in the live tables.
1. Store
Max Timestamp/Value
insert into ETL_Table_Last_Entry
Select 'G_L_Entry' TableName,B.Company, isnull(max(timestamp),0x0000000000000000) TimeStamp
from
dbo.[G_L_Entry] B
--Where [Posting Date] >@Date
Group By B.Company
2. Find
Last value and store in the variable
SELECT dbo.fnTS2VC([TimeStamp]) AS t
FROM ETL_Table_Last_Entry
WHERE (Company = 1) AND (TableName = 'G_L_Entry')
3. Truncate
temporary table
truncate table tmp_GL_Entry
4. Add
Data flow task and add latest records
"Select
* from dbo.[" + @[User::Company_Name] + "$G_L Entry]
where timestamp > 0x" +
@[User::PV1] + " order by
timestamp"
In above query we taking those record which are
greater then our stored value, We have stored above query in variable to get
the dynamic execution based on the multiple tables.
In Source we have execute the query
5. Delete duplicate record
2. Find Last value and store in the variable
4. Add Data flow task and add latest records
Thank you so much for this nice information. Hope so many people will get aware of this and useful as well. And please keep update like this.
ReplyDeleteBig Data Consulting Services
Data Lake Solutions
Advanced Analytics Services
Full Stack Development Solutions