Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Strange Excel File.

Author  Topic 

sg2255551
Constraint Violating Yak Guru

274 Posts

Posted - 2013-04-26 : 03:36:15
hi

I have about 150 excel files in C:\ExcelFiles.

I have created a SSIS package using For Each Loop with Excel as source and DB as destination.

Many of these files are exported to this directory.

The strange part is that there is nothing wrong with the package but only excel files.

What i meant is only those file that i opened physically like file 1 to 10 and just hit CTRL S to save and execute the package, the import would stop at file 10. So, if i want the package to process let say file 11 to 20, i would need to open file 11 to 20 first and save and then execute the package, it would go on to process file 1 to 20 only.

What must i do to resolve this? Thanks a lot

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-04-26 : 04:05:14
it seems the issue with logic you included within for each loop. Is there any checking logic written inside your for each loop before the actual data flow task?

Also are the excel files in correct format when it arrives in directory?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

sg2255551
Constraint Violating Yak Guru

274 Posts

Posted - 2013-04-26 : 04:10:29
hi

All excel files are in exact format and there isn't any logic checking. Thanks
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-04-26 : 04:14:45
which provider you're using for excel connection manager and what are formats of excel spredsheets when they arrive at directory?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

sg2255551
Constraint Violating Yak Guru

274 Posts

Posted - 2013-04-26 : 05:09:59
hi

I am using this connection string properties.
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + @[User::Filename] + ";Extended Properties=\"Excel 8.0;HDR=YES\";"

and this is the Openrowset properties:
SBNB$A3:B

All excel files format is 97-2003 when they arrived, but my server has only office 2010 installed.

Thanks a lot
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-04-26 : 05:15:03
thats ok so far as you've correct version selected in excel connection manager.I hope its in native xls format and not in macro enbaled or csv formats

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

sg2255551
Constraint Violating Yak Guru

274 Posts

Posted - 2013-04-26 : 06:20:26
I have no macro or CSV format. Anyway, i actually opened all files and save again. Now it works fine. Just do not know why it have to be done in this way. Thanks a lot
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-04-26 : 06:34:17
may be issue with format in which it was generated. Any idea on how they're getting generated?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

sg2255551
Constraint Violating Yak Guru

274 Posts

Posted - 2013-04-26 : 10:32:28
It was exported from a click of button "Export To Excel" of a web site. User would then prompted To Open, Save or Save As. They choose Save As so that it would be saved to the destinated directory. I guess this maybe the cause of the problem. Thanks a lot
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-04-29 : 00:49:40
ok.
worth checking on whether they can make format consistent

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -