question

tlenzmeier avatar image
tlenzmeier asked

Parameterized Queries in the Execute Sql Task

I am trying to do the following: 1. Execute a For Loop container that will loop through each day in 2015. I have the container set up with three variable: DateStart, DateEnd, Interval. The initial expression is a variable that equals 1/1/2015. The EvalExpression is <= 12/31/15, and the AssignExpression is DATEADD("d", 1, @[User::Interval]). The variables all have a data type of DateTime. The execute SQL task uses an OLE DB connection. The test SQL statement is `USE dbo.Table1 DECLARE @Interval = DATE SET @Interval = ? Select MAX(CREATED_DT) FROM Table1 WHERE CREATED_DT = @Interval` The parameter mapping is User::Interval/Input/DBDATE, 0/ -1. I am missing something since the package fails with an error message saying unsupported data type on parameter bind . . .
ssissqlserver 2008r2
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.