![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Perhaps somebody in this news group knows. In SSIS I have a foreach container thats got an filename enumeration collection of files in a directory stored in a variable I call FileName. Inside the foreach container, I have script task (vb.net) that I want to pass that FileName variable to. So I presume I pass it as a ReadonlyVariable. In the script task I'm setting the ReadOnlyVariables to @[User::FileName] : Imports System.IO Imports System Imports System.Data Imports System.Math Imports Microsoft.SqlServer.Dts.Runtime Public Class ScriptMain Public Sub Main() Dim fname As String = CType(Dts.Variables("FileName").Value, String) File.Move(fname, fname + ".processed") Dts.TaskResult = Dts.Results.Success End Sub End Class But now getting this error: Error: Failed to lock variable "\\xxxx\Data\f1.csv" for read access with error 0xC0010001 "The variable cannot be found. This occurs when an attempt is made to retrieve a variable from the Variables collection on a container during execution of the package, and the variable is not there. The variable name may have changed or the variable is not being created.". As you can see the variable does appear to be resolving .. but the step is still failing |
![]() |
| Thread Tools | |
| Display Modes | |
| |