-1

For this diagram:

SSIS Package

The "Get Score Files" Script obtains a list of files and puts them into a User Variable filelist (datatype object). That list is THrown into the "Find Score Files" Loop, and will process each item on the list.

I need it to run ONLY if their's files to be had. If the "Get Score Files" Script returns NO objects, I want the Package to End Successfuly. How do I tell it to do that?

Thanks

arcee123
  • 101
  • 9
  • 41
  • 118
  • Add a [expression constraint](https://blogs.msdn.microsoft.com/mattm/2006/10/30/using-constraints-and-expressions/) between Get Score Files and Truncate STAGE that checks the value of your variable. – JodyT Nov 08 '16 at 12:28
  • Possible duplicate of [SSIS Count of Object Variable?](http://stackoverflow.com/questions/8537403/ssis-count-of-object-variable) – Tab Alleman Nov 08 '16 at 13:20

1 Answers1

1

In "get score file" try this code

  if (files.Count == 0)
            {
                Dts.Variables["files_present"].Value = false;

            }
            else
            {
                Dts.Variables["file_list"].Value =files;
                Dts.Variables["files_present"].Value = true;

            }`

In SSIS u should create one more variable(files_present) with bool type

Now in the precedence constraints expression before for each loop use files_present variable to check any file present or not`(if true file present else no files)