I have a 'Modified Date Column' in the source table and I need to extract the recent data
Recent data - Data in the date between the recent execution of SSIS package to till date(Current execution date).
How can this be acheived in SSIS?
I have a 'Modified Date Column' in the source table and I need to extract the recent data
Recent data - Data in the date between the recent execution of SSIS package to till date(Current execution date).
How can this be acheived in SSIS?
You can achieve that by using SQL Task to get the last execution date from Job History in msdb database and store it in a variable.
You can use this query
USE msdb
GO
DECLARE @JobName AS varchar(50)
--Put the name of the job that runs package
SET @JobName = 'UpdateFactura'
SELECT
MAX(DBO.AGENT_DATETIME(RUN_DATE, RUN_TIME)) AS [Last Time Job Ran On]
FROM dbo.SYSJOBS SJ
LEFT OUTER JOIN dbo.SYSJOBHISTORY JH
ON SJ.job_id = JH.job_id
WHERE JH.step_id = 0
AND jh.run_status = 1
AND Sj.name = @JobName
GROUP BY SJ.name,
JH.run_status
ORDER BY [Last Time Job Ran On] DESC
GO
In the SQL Task set single result and map the result to the variable. Now you can use the variable for retrieve the modified data from last package execution.
Let me know if this was helpful.