Search code examples
sql-serverssisetlforeach-loop-container

use case to 'Name and Extension', 'Full Qualified' and 'Name Only' options in foreach file enumerator in ssis


I am trying to find the use case scenario for when to use

  1. Name and Extension
  2. Fully Qualified
  3. Name Only

while importing flat-file type files from source in SSIS.

Would anyone help me understand the use case scenario for each of the 'retrieve file name' types?

Thank you for giving your valuable time!


Solution

  • Assume that you are looping over text files stored within a directory C:\My_Files\. The following table shows how the file enumerator retrieve the filename using each option:

    Option Example Use case example
    Fully Qualified C:\My_files\example.txt Importing data from multiple files into an SQL databases
    Name Only example Executing a conditional task based on the file name. For example, adding a task that checks the file name, then using precedence constraints to execute a Process Task based on the file name
    Name and Extension example.txt Importing data from multiple files - Executing a conditional process task based on the file name and extension - Copying/Moving files from one directory to another one and keeping the file name

    This option is selected based on the logic you are trying to implement. I highly recommend referring to the following article for more details: