Reputation: 997
I have some variables (at package level, at dataflow level, doesn't matter) and I need to load them by running an Execute Sql Task
.
I added an Execute Sql Task
, I have wrote my sql statement in filed SqlStatement
, I have changed the ForcedExecutionValueType
to string
.
Now I want that when the Execute Sql Task
is executed the return value that that select returns, to be the exact value for my variable.
example:
Select employer_name from employers where id=1
Returs="John Doe"
value for @employer_name must be "John Doe"
Any hints?
Upvotes: 1
Views: 7147
Reputation:
Your more detailed discussion of the issue is a little difficult to follow, so I aplogize if my following steps cover items with you are already familiar.
Steps:
Running the Execute SQL Task by itself will now populate the variable. Make certain you've verified that the SQL will return only one value and no more. Otherwise, you will need to modify your SQL with "TOP 1" in it to be on the safe side. When multiple values are expected, then you to apply a variable defined with a Data Type of "Object" and use "Full Result set" instead of "Single Row" in the Execute SQL Task.
Hope this helps.
Upvotes: 3