Skip to content
October 28, 2013 / João Lobato Dias

SSIS: The wrapper was unable to set the value of the variable specified in the ExecutionValueVariable property

Problem:

Last Tuesday I stumbled on a odd error message in SSIS:

“Error: The wrapper was unable to set the value of the variable specified in the ExecutionValueVariable property.”

At the moment, I was trying to use a File System Task with a Delete file operation to delete a temporary file. The oddest thing about it was that the error was being thrown after the file had been successfully deleted.

Technical Explanation:

This (seemingly not very enlightening) error message is related to two properties common to all SSIS tasks: ExecutionValue and ExecValueVariable. The former can be used by a task to return an interesting value; the latter is the variable where that value will be written, becoming accessible to the following tasks.

In hindsight, the error message is pretty accurate: the failing task is trying to return a value, but it is unable to fit it in the selected variable.

Solution:

Turns out that it was a data type mismatch.

When configuring the task, I chose a variable for the Source propertyBy default, the same variable was chosen for the ExecValueVariable property. Since the source was a string path and the return value was an integer (i.e., the number of deleted files), the task was throwing an error after performing the operation.

ssis_properties_executionvaluevariableIn order to solve the issue, either point the ExecValueVariable to an Int32 variable or choose the <none> parameter (thus ignoring the return value). Note that a File System Task with a Delete file operation will succeed even if the file weren’t there in the first place. You’ll need to check the ExecutionValue if you want to use that piece of information.

Helpful links:

http://www.sqlis.com/sqlis/post/Have-you-used-the-ExecutionValue-and-ExecValueVariable-properties.aspx

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: