Send email if Foreach loop container, does not find files

  • Hi All,

    I have a foreach loop container that copies *.csv files (using a file system task) from one folder to another.

    How would I send an email if not files are found by the foreach loop container?

    I am not sure what expression to use in the Precedence Constraint Editor.

    The variable that the foreach loop container uses is called 'FilesToMove'.

    I have tried using an expression such as @filesToMove == Null without success.

    Many Thanks.

    Chris

  • Resolved by using Script task with following code:

    Option Strict Off

    Imports System

    Imports System.Data

    Imports System.Math

    Imports Microsoft.SqlServer.Dts.Runtime

    Public Class ScriptMain

    Public Sub Main()

    Dts.Variables("User::Count").Value = Dts.Variables("User::Count").Value + 1

    MsgBox(Dts.Variables("User::Count").Value.ToString())

    Dts.TaskResult = Dts.Results.Success

    End Sub

    End Class

    Then placed a precedence constraint to check the variable

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

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