3 Comments

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.

3 Replies to “SSIS Flat File Source Error: 0xC020200E Cannot open the datafile and 0xC004701A failed the pre-execute phase”

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

  2. This error also occurs when the parameter in the configure option is copied with a little space in it. The error would be like cannot open the data file or xyz.txt file is missing from the path specified eg :-“C:\Test\data xyz.txt”, notice how there is a space after the file path, which results in the error

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Posts