You have a SQL Server Integration Services (SSIS) package. The package contains a script task that has the following comment.
// Update DataLoadBeginDate variable to the beginning of yesterday
The script has the following code.
Dts.variables[''User::DataLoadBeginDate''].Value = DataTime.Today.AddDays(-1);
The script task is configured as shown in the exhibit. (Click the Exhibit button.)
When you attempt to execute the package, the package fails and returns the following error message: ''Error: Exception has been thrown by the target of an invocation.''
You need to execute the package successfully.
What should you do?
You add existing variables to the ReadOnlyVariables and ReadWriteVariables lists in the Script Task Editor to make them available to the custom script. Within the script, you access variables of both types through the Variables property of the Dts object.
References:
https://docs.microsoft.com/en-us/sql/integration-services/extending-packages-scripting/task/using-variables-in-the-script-task?view=sql-server-2017
Currently there are no comments in this discussion, be the first to comment!