Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 SSIS package parameters

Author  Topic 

skybvi
Posting Yak Master

193 Posts

Posted - 2011-05-12 : 13:41:09
Hi,
I have a SSIS package which has a t sql query running. In that:
select ...
from...
WHERE DT > '2011-04-01'
and DT < '2011-04-30'

I want to put parameters for date and I want to run this in a job step in SSMS.
But the point where I am stuck is that, I want these dates to be 1 week earlier from the time the job runs...

FOr example
If job runs on sunday night (15th may)
Then the dates should be from 8th may - 14th may
Similarily, the next job runs on 22nd may and dates should be from
15may-21 may.

Also, how could the data add upto the previous data..
Like if the first time job runs i have 400 rows( in output table),
then next weekend the job runs another 450 rows, so I want my output table to have 850 rows in total..

Somebody can give me an insight on how to proceed :
Thanks


Regards,
Sushant
DBA
West Indies

shangbaby
Starting Member

3 Posts

Posted - 2011-05-17 : 08:03:35
Use a stored procedure that requested the to and from dates in SSMS, then use that stored procedure in the SSIS Package. Then use a foreachloop container to iterate through the results and append one result set consistantly over time when that package is run.

Shangz R Brown
SQL DATABASE DEVELOPER
SSRS, SSIS, T-SQL, BIDS
Go to Top of Page
   

- Advertisement -