I have quite a large table that I need to import into my BI environment for reporting. I have an SSIS package that calls a stored procedure runs every 20 minutes to extract data from source and populate it into my table. The earliest date on the source table is 01-January-2012.
What I would like is for the first time the package runs it will import all the data from source for the month of January 2012. The next time it runs it will populate all the data for February 2012 and so on.
The below is the query I would use to extract the data - this is based on Created and Modified Dates
Select ID, Name, Company, Job, HRID, PayID, CreatedOn, ModifiedOn
from dbo.HRDetails
where CreatedOn between @MonthStart and @MonthEnd
or ModifiedOn between @MonthStart and @MonthEnd
I just need help on how I would make this incremental to pick up the data month on month dynamically?
Any help would be appreciated
-Jess