Wednesday, February 1, 2012

Get file names using

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

Public Sub Main()
        Dim varCollection As Variables = Nothing

        If File.Exists(varCollection("User::FilePath").Value.ToString()) Then
            MessageBox.Show("File found.")
            MessageBox.Show("File not found.")
        End If

  Dts.TaskResult = ScriptResults.Success
 End Sub
You could pass 0 or 1 and use the 'Precedence constraints' to evaluate your next step.
Hope that helps someone. 

No comments:

Post a Comment