May 31, 2015 at 11:50 pm
Hi All,
I have a ssis package, which runs on date parameter. If we dont specify the date it always load data for yesterday's date. And if we give any specific date like '2015-05-10', It should load for that date. How can we achieve this dynamically (using package configuration)? Once we load for any specific date, package should be set for yesterday's date dynamivally. Please guide me to achieve this as I am new to SSIS.
Thanks in advance
June 1, 2015 at 7:59 am
Well I'm no SSIS expert but assuming you have a stored procedure as your data source you could do something like this.
CREATE PROCEDURE DefaultTest
@date_param DATETIME = NULL
AS
SET NOCOUNT ON
DECLARE @date DATETIME
IF @date_param IS NULL
BEGIN
SET @date = GETDATE()-1
END
ELSE
SET @date = @date_param
SELECT @date
June 1, 2015 at 10:01 am
I'd do it as YB mentioned, but using SSIS. You have your parameter and a variable that should work as an expression where you use conditional (condition?true:false) to evaluate if your parameter is empty or has a valid date.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply