• Phil Parkin (11/14/2013)


    Are there any other errors? The one you posted doesn't really help that much, unfortunately.

    Are you saying that all packages containing scripts fail when run under SQL Agent, or just this one?

    No, there are no other errors. Just this one Error:

    Source: Set FS File Parameters Script Task Description: Exception has been thrown by the target of an invocation.

    None of the other packages with script task are failing when run by the sql agent under proxy account. Only this one fails, and the difference is this one uses System.IO; and the related code:

    DirectoryInfo dir = new DirectoryInfo(dirPath);

    foreach (FileInfo file in dir.GetFiles())

    {

    if (file.Extension.Contains(fileExt)

    && file.Name.StartsWith("DoNotDeleteTemplate") == false

    && file.Name.Contains("Products") == true

    && file.Name.Contains("Special") == false

    && file.Name.Contains("Exclude") == false)

    {

    FileName = file.Name;

    FileSize = (int)file.Length;

    FileType = file.Extension;

    }

    }

    Forum User:cool: