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

Pass a variable value to SQL Command in OLEDB Source

$
0
0

Hi,

  I have the OLEdb Source where it has SQL Command as Data Access Mode. Below is the sample query that i have in that.

DECLARE @MonthOffSet int = 24
DECLARE @PaidDate_SK_Lowdatetime = dateadd(mm,MONTH(getdate())-@MonthOffSet-1,dateadd(year,datediff(year,0,dateadd(YY,0,getdate())),0))
DECLARE @PaidDate_SK_Highdatetime = dateadd(dd,-1,dateadd(MM,@MonthOffSet,@PaidDate_SK_Low))

followed by select statement which has where clause.

 Instead of hard code the value 24, i am trying to get the value from variable. I know there is a limitation to add the parameters only in where clause. Is there any work around or solution.


Viewing all articles
Browse latest Browse all 24688

Trending Articles



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