Romano Zumbé
Romano Zumbé

Reputation: 8079

SSIS foreach loop takes wrong file

I'm developing a SSIS Package that copies contents of specific files to a database. In this package I mak heavy use of the foreach container. Today I came across a strange behavior and have no clue whats wrong. In one of the containers I filter for "VBFA*.txt". But for some reason the container also gets triggered for a file called "VBAP.D2014211.T204008397.R000564.txt". When I change any part of that filename it doesn't trigger the container anymore. Additionally there are plenty of other files that start with "VBAP" and don't trigger the container. What could be the reason for this behavior?

Here is the enumerators implementation:

<DTS:ForEachEnumerator>
<DTS:Property DTS:Name="ObjectName">{6E07E755-700D-4D7D-9550-E08DA5B81264}
</DTS:Property>
<DTS:Property DTS:Name="DTSID">
{f0ceed84-f95c-404c-8794-2eec0155d1a6}</DTS:Property>
<DTS:Property DTS:Name="Description"></DTS:Property>
<DTS:Property DTS:Name="CreationName">DTS.ForEachFileEnumerator.2</DTS:Property>
<DTS:ObjectData>
  <ForEachFileEnumeratorProperties>
    <FEFEProperty Folder="\\desoswi0204vs\etldata\transfers\out\DP"/>
    <FEFEProperty FileSpec="VBFA*.txt"/>
    <FEFEProperty FileNameRetrievalType="0"/>
    <FEFEProperty Recurse="0"/>
  </ForEachFileEnumeratorProperties>
</DTS:ObjectData>
</DTS:ForEachEnumerator>

Upvotes: 2

Views: 261

Answers (1)

Romano Zumb&#233;
Romano Zumb&#233;

Reputation: 8079

I've checked the paths contents with dir /x and the short name of my file is wrong. For the file "VBAP.D2014211.T204008397.R000564.txt" the shortname is "VBFA08~1.TXT". The full result is:

01.08.2014 11:02 1.067.169 VBFA08~1.TXT VBAP.D2014211.T204008397.R000564.txt

I have absolutely no clue, what is happening here and how to stop it. This violates every rule I've found regarding the short filename creation. I leave this as the answer for everybody else who is comming accross this beahvior, which is also the case for c# Directory.GetFiles

Upvotes: 1

Related Questions