ssis - Load data for yesterday's date and specific date -
i have ssis package, runs on date parameter. if dont specify date load data yesterday's date. , if give specific date '2015-05-10', should load date. how can achieve dynamically (using package configuration)? once load specific date, package should set yesterday's date dynamivally. please guide me achieve new ssis.
thanks in advance
add parameter package paramdate
. parameter has manually provided value(e.g. 03-21-2015). leave blank(null value) if yesterday's date has considered.
now define variable inside package vardate
have expression vardate
-
isnull(@[$project::paramdate])?dateadd("day", -1, getdate()):@[$project::paramdate]
i assuming loading data in dft.
so in source query that, need add condition in where
clause
select ...... sometable loaddate = ?
in "parameters..." section of source, assign variable vardate
0
. further details on how map parameters see here.
hope helps.
edit tagged under ssis 2012,my solution involved project parameter, feature under project deployment model. package configurations on hand under package deployment model.
if want use sql server package configuration table, can follow steps below:
lets table's name ssisconfiguration
have
execute sql task
read date table.select isnull(tstampupdatedate, dateadd(dd, -1, getdate()) ssisconfiguration
this script fetch value of tstampupdatedate
ssisconfiguration
table , if null
(set below), return yesterday's date.
map result set variable
@vardate
.have 1 more
execute sql task
after step update field null.rest of steps same above(starting dft bit).
next time package runs, if date field not updated, query per yesterday's date.
Comments
Post a Comment