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

Evaluation of expression into OLE DB Source component

$
0
0

Dear All,

I built a parametric query (that I saved into a variable named "User::QueryString") like this:

"SELECT * FROM "+@[User::TableName]+" WHERE "+@[User::PrimaryKeyName]+"="+@[User::Value]

("User::TableName","User::PrimaryKeyName" and "User::Value" values change during my "execution flow" and, for "User::QueryString" I enabled the "EvaluateAsExpression" option)

Then, in a Data Flow task, I inserted an "OLE DB Source" component, I chose the option "SQL query from variable" and I specified my "User::QueryString" as variable.

What I noticed is that this expression is evaluated only the first time (let's say, when I put the component into my data flow task) and, even if the value of "User::TableName","User::PrimaryKeyName" and "User::Value" changes (due for example to iterations of a Foreach Loop), the expression is never "updated" into the "OLE DB source" component (It seems that it's evaluated only at creation time of the component, in a static way)

Is there a solution (or even better some tricks) to overcome this problem?

Thanks for your help



Viewing all articles
Browse latest Browse all 24688

Trending Articles