Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

How to use DECLARE in SSIS

$
0
0

Hello All,

Till now i have used packages to load data using SELECT statement, but now i need to DECLARE a date before the SELECT and i can run it fine in the management studio, but cannot in SSIS. Can someone please tell me if i have to use some other task before the data flow task. My sql is like below.

Thanks

DECLARE @d DATE = CASE WHEN DATEPART(DW, GETDATE()) = 2
                       THEN DATEADD(D, -3, GETDATE())
                       ELSE DATEADD(D, -1, GETDATE())
                  END;
SELECT STATEMENT


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>