0

In the Control Flow, I created a Execute SQL Task in SSIS. In the General tab, under SQLStatement I am able to write my query. Something like this:

select config_value from config_table where name ='ArchiveDays'

In the Parameter Mapping tab, I am able to create variable: User::ConfigValue

In the Result Set tab, I have the following: https://dl.dropboxusercontent.com/u/12421846/ssis/result_Set.JPG

I am able to run the Execute Data Flow Task without issue.

How can I check the value in the variable after I run the dataflow?

In the Control Flow, Data Flow task, I have a OLE DB Source, I try to use the variable created. The query parses, but I get the following Error message.

https://dl.dropboxusercontent.com/u/12421846/ssis/error_msg2.JPG

How to resolve? Am I missing something?

1 Answer 1

2

That's not how you map parameters in SSIS. Documentation is going to be helpful in your career and books online is the place to start.

Parameterization in an OLE DB Source is accomplished through the use of ? which is an ordinal, zero-based replacement scheme.

Your query would need to be rewritten to use the parameters. And it should also be re-written to not be lazy. Something like

WHERE CAST(CreatedOn as date) < dateadd(DAY, ?, CURRENT_TIMESTAMP)

And that is where you'd map in your @User::carepro_ConfigValue

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.