Possible to create a file name via Flat File connection manager & expression?
I'm trying to create a file name at package runtime, using a flat file connection manager. The package continues to fail with the following error message: "[Flat File Source [2]] Error: Cannot open the datafile "C:\Project\MyExtract2012-07-16.txt". [SSIS.Pipeline] Error: Flat File Source failed the pre-execute phase and returned error code 0xC020200E." Details - Package contains a single data flow with a Flat File Source, Flat File Connection Manager, and OLE DB Destination. - The ValidateExternalMetadata property of the source is set to False. - The Flat File Connection Manager is configured to point to an existing file (c:\Project\MyExtract.txt) on the local machine. - The DelayValidation property for the connection manager is set to True. - The following expression is used to update the connection string at run time, to create a file name with todays date in the same folder that the Flat File Connection Manager is configured to point to. "C:\\Project\\MyExtract" + (DT_WSTR, 30)(DT_DBDATE)GETDATE() + ".txt"Carla Sabotta
July 16th, 2012 8:20pm

Hi Carla, With your explanation I am able to make out that you are trying to read the file on not create one, please correct me if I am wrong? Since the Flat File connection is used in the source, it is trying to read a file called "C:\Project\MyExtract2012-07-16.txt" which obviously does not exist. If you want to create a file, the file connection should be used in the Flat File Destination. Let me know if my understanding is wrong. Thanks, Vinaya
Free Windows Admin Tool Kit Click here and download it now
July 16th, 2012 10:10pm

Thank you Vinaya. That was the mistake I was making -- using the source rather than the destination.Carla Sabotta
July 16th, 2012 10:23pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics