Script Task hanging

  • I am using a Script Task to find out if a folder / file exists using:

    Dim dir As New DirectoryInfo(Dts.Variables("strSourceDirectory").Value)

    'Check the directory and sourcefile(s) exist

    If Not dir.Exists Or Not File.Exists(Dts.Variables("strSourceFile").Value) Then

    Dts.Variables("bolSourceFileExists").Value = False

    Dts.Variables("strError").Value = "Source directory / file does not exist"

    Dts.TaskResult = ScriptResults.Failure

    Else

    Dts.Variables("bolSourceFileExists").Value = True

    Dts.TaskResult = ScriptResults.Success

    End If

    However, when I run it the Script Task box stays yellow, just seems to hang and doesn't carry on along the relevant precedence. If I add the Dts.TaskResult = ScriptResults.Success at the end as a test and remove both occurences from inside the loop it runs.

    What am I missing?

  • Hi Steve,

    The script is simple enough. I would concentrate on the variables. You probably have contention where the same variable is being accessed from multiple simultaneous places.

    ---
    SSIS Tasks Components Scripts Services | http://www.cozyroc.com/

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply