Glews
Glews

Reputation: 87

SSIS package File enumerator empty when package is executed outside of visual studio

I have a SSIS package that i want to use in a job that populates a table from a flat file located on file system. Since it's a nightly delta file im using foreach enumerator for the file path and a variable for the file name. When i execute it from visual studio it works fine and the table gets populated with data. But when i execute it as an SQL Agent job or just run the package i get this warning message:

empty file foreach enumerator

And the table is not populated with data and I have also doubble checked that a file is in the directory.

Any ideas on what i can do to solve this problem?

Thank you!

Upvotes: 0

Views: 2136

Answers (2)

kontrolltermin
kontrolltermin

Reputation: 1

*You must have 50 reputation to comment

Thank you so much.

"I then changed it to

    Z:\Folder\FolderWithFiles\

and it worked outside of visual studio (execution of the package)."

This comment helped me alot today. The exact same package worked with Visual Studio 2013 and Server 2014 but i had trouble migrating it to Visual Studio 2019 with Server 2019

Upvotes: 0

Glews
Glews

Reputation: 87

The problem was in the foreach enumerator folder. When I used

Z:\Folder\FolderWithFiles

It didn't work. I then changed it to

Z:\Folder\FolderWithFiles\

and it worked outside of visual studio (execution of the package).

When i then tried using the UNC path:

\\Server.Domain\DomainFolder\Folder\FolderWithFiles\

It worked using a SQL Server Agent Job.

To summarize: Be sure that you have the correct path and directories on your file enumerator.

Upvotes: 1

Related Questions