A recent question about how to check the value of a STRING variable in SSIS 2008 ?
If you need to check for file existence on the disk...use that
1-Imports System.IO
2- assuming your var holds a string of full pat ,ex: C:\file.txt
Hope that helps someone.
If you need to check for file existence on the disk...use that
1-Imports System.IO
2- assuming your var holds a string of full pat ,ex: C:\file.txt
Public Sub Main()You could pass 0 or 1 and use the 'Precedence constraints' to evaluate your next step.
Dim varCollection As Variables = Nothing
Dts.VariableDispenser.LockForRead("User::FilePath")
Dts.VariableDispenser.GetVariables(varCollection)
If File.Exists(varCollection("User::FilePath").Value.ToString()) Then
MessageBox.Show("File found.")
Else
MessageBox.Show("File not found.")
End If
Dts.TaskResult = ScriptResults.Success
End Sub
Hope that helps someone.
No comments:
Post a Comment