0

Need to upload excel file using Script task in SSIS 2005. Can someone please help, provide the code.

Regards

Conrad Jagger
  • 643
  • 6
  • 19
  • 31

1 Answers1

0

I always use OLEDB for this and I answered this recently with a code sample here...

Best fastest way to read an excel sheet

I've always found it the best way, mainly because using a data flow task with an Excel Source doesn't allow you to either vary the Excel or to validate it's contents.

Community
  • 1
  • 1
Ciarán
  • 3,017
  • 1
  • 16
  • 20
  • Dont have ACE.OLEDB.12.0 installed on the dev machine, should we just change to JET OLEDB provider – Conrad Jagger Jan 15 '13 at 10:47
  • If you dont mind, can you provide me code for this section - While oleExcelReader.Read .....End While - This will insert into database (assumption lets say we have 3 fields) – Conrad Jagger Jan 15 '13 at 10:48
  • 2
    This is deliberately left blank because it's rather implementation dependent. E.g. What is your destination database? SQL/Server, Oracle, MySql etc? You can use Microsoft.Jet.OLEDB.4.0 (with Excel 8.0) but this will only open pre 2007 .xls files. The ACE.OLEDB.12.0 is very easy to install and is free. It will open both. – Ciarán Jan 15 '13 at 11:49