question

vsrini008 avatar image
vsrini008 asked

Import multiple excel 2010 files to SQL 2008 r2

I have bunch of excel 2010 files, need them to import into SQL 2008 r2. Explain me various ways to import them. (I have tried using SSIS, SQL Import Wizard, Open Rowset, Manual Copying by editing the table, but failed in some situations) appreciate your concerns !!
sql-server-2008sql-server-2005sqlssissql-server-2008-r2
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

vsrini008 avatar image
vsrini008 answered
Finally managed to solve using "OPENROWSET". Gone through various forums to fix it ( http://visakhm.blogspot.in/2013/12/how-to-solve-microsoftaceoledb120-error.html)
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

erlokeshsharma08 avatar image
erlokeshsharma08 answered
If the structure is same for all the files across all sheets then ssis is the best bet....search for loading multiple excel files with multiple sheets into sql database; you will get tons of articles. .. It would require 2 looping mechanisms ...one through sheets and one through files
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

vsrini008 avatar image vsrini008 commented ·
I have tried doing that but failed in particular columns...Thanks for your points
0 Likes 0 ·
erlokeshsharma08 avatar image
erlokeshsharma08 answered
If the structure is same for all the files across all sheets then ssis is the best bet....search for loading multiple excel files with multiple sheets into sql database; you will get tons of articles. .. It would require 2 looping mechanisms ...one through sheets and one through files
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

vsrini008 avatar image
vsrini008 answered
Useful breaks --Excel 2007-2010 SELECT * --INTO #productlist FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0 Xml;HDR=YES;Database=C:\temp\Products.xlsx', 'SELECT * FROM [ProductList$]'); --Excel 97-2003 SELECT * --INTO #productlist FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;HDR=YES;Database=C:\temp\Products.xls', 'select * from [ProductList$]');
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.