Domanda

I created a package in which I am fetching data from excel files and dumping to SQL tables. There are around 6-7 excel files. I used Execute SQL task and Data Flow Task inside For each loop container. The Execute SQL task creates a table with same name as excel and DFT loads the data from this excel to SQL table. My problem is that Execute SQL task is creating an extra table and due to this my package fails. For Example - I have 5 excel files. Excel1, Excel2, Excel3, Excel4, Excel5

My package creates SQL table with exactly same name and load this table one by one. After populating 5 tables - Excel1,Excel2,Excel3,Excel4 and Excel5, Foreach Loop container iterates one more time and creates a table as '~Excel23' and package fails after that.

Please can somebody help me why an extra table is created in my package?

È stato utile?

Soluzione

Looks like Foreach File Enumerator takes also temporary excel files from your directory (it starts with '~'). When you specifies SpecFile property use 'E*.xls' instead of '*.xls' (in case if all your files starts with 'E')

OR

use Custom Foreach File Enumerator with regexp to specify filenames that you need.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top