SSIS Flat File Source Error: 0xC020200E Cannot open the datafile and 0xC004701A failed the pre-execute phase

I was getting an error when importing a csv file, by using the SSIS Flat File Source.

 

Error

Error: 0xC020200E at Read Flat File [18]: Cannot open the datafile "".
Error: 0xC004701A at Import File, SSIS.Pipeline: component "Read Flat File" (18) failed the pre-execute phase and returned error code 0xC020200E.

 

Cause

This was because the flat file source connection string was created by an expression. The expression used a parameter and this parameter was empty.

 

Solution

When the parameter was filled with the correct value, eg “C:\Data\Test.csv”, the error was solved.

Leave a Reply

Your email address will not be published. Required fields are marked *

2 comments

  1. Jason Yousef says:

    I had the same error and the file was opened in Excel, it was a CSV file with basic load package.

  2. Kristl says:

    that was the issue for me as well. I had the file open in Excel. Closed it, it was fine.