locked
Extracting and loading data from Zipped CSV files to a SQL database RRS feed

  • Question

  • Hi

    Extracting and loading data from Zipped CSV files to a SQL database

    As I discussed in the http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/3d2a1ea9-bf09-4f8d-ab87-050c75751199” Post, I have a problem in loading zipped data to SQL database. Here I want to show more details hoping that somebody would help me.

    Here is a snapshot of my package:

    This is property of Foreach Zipped file and the following is property of “Foreach loading CSV files to a database” loop (this Foreach loop is working fine itself).  First loop reads zipped files from E:\temp and unzips them to the C:\test\unzipped. The second loop reads unzipped CSV files from C:\test\unzipped. But the second loops causes error





    Error: 0xC020200E at Data Flow Task, Flat File Source [1]: Cannot open the datafile "".

    Error: 0xC004701A at Data Flow Task, SSIS.Pipeline: component "Flat File Source" (1) failed the pre-execute phase and returned error code 0xC020200E.

    In the each loop I used a string variable. strZipFile variable for first loop and varFilePath variable for the second loop as you can see in the following snapshot:

    Both variables are in the Package Scope. I also got help from https://duncansutcliffe.wordpress.com/2010/04/14/unzipping-and-zipping-files-in-ssis/ to unzip files using SSIS.

    I will appreciate for helps.



    Wednesday, October 24, 2012 1:52 PM

Answers

All replies

  • Do not nest one ForEach Loop into the other - this is the problem

    You need to unzip them in a separate step.

    Thing is when the package executes, the 2nd loop does not see the unzipped files in the previous loop.

    Separate them totally - take the unzipping out and make it a separate step


    Arthur My Blog

    Wednesday, October 24, 2012 2:05 PM
  • Do not nest one ForEach Loop into the other - this is the problem

    You need to unzip them in a separate step.

    Thing is when the package executes, the 2nd loop does not see the unzipped files in the previous loop.

    Separate them totally - take the unzipping out and make it a separate step


    Arthur My Blog


    Why not Set DelayValidation to true if availability of the files is an issue. Am I missing something here?

    Rajkumar

    • Proposed as answer by UlfenB Thursday, October 25, 2012 12:12 PM
    • Unproposed as answer by farhad koohbor Saturday, October 27, 2012 11:04 AM
    Wednesday, October 24, 2012 3:42 PM
  • Do not nest one ForEach Loop into the other - this is the problem

    You need to unzip them in a separate step.

    Thing is when the package executes, the 2nd loop does not see the unzipped files in the previous loop.

    Separate them totally - take the unzipping out and make it a separate step


    Arthur My Blog


    So How should I separate them? I think the second loop needs the output of the first one. Could you please explain?
    Saturday, October 27, 2012 11:11 AM
  • I found the solution
    • Proposed as answer by ArthurZ Monday, October 29, 2012 2:45 PM
    • Marked as answer by Eileen Zhao Monday, November 5, 2012 7:53 AM
    Saturday, October 27, 2012 12:20 PM
  • That is a graphical representation of what I was trying to tell you (Separate them totally - take the unzipping out and make it a separate step).

    Arthur My Blog

    Monday, October 29, 2012 2:44 PM