none
Export Excel to Sql Server 2008 using SQL Server Management Studio on Windows 7

    Question

  • Hi

    I need to export data from one Excel shhet to a table

    I use

    USE Banco
    GO
    SELECT * INTO Empleados FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 12.0;Database=C:\BaPro\Cuentas.xlsx;HDR=YES', 'SELECT * FROM [Hoja1$]')

    This returns this error:

    Msg 7357, Level 16, State 2, Line 1

    Cannot process the object "SELECT * FROM [Hoja1$]". The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" indicates that either the object has no columns or the current user does not have permissions on that object.

    If I change the Excel extension to xls instead of xlxs returns this error

    Msg 7399, Level 16, State 1, Line 1

    The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" reported an error. The provider did not give any information about the error.

    Msg 7303, Level 16, State 1, Line 1

    Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".

    But I use with previous versions on XP and this works fine.

    Can any help me?

    TIA.  

    Wednesday, June 15, 2011 11:36 AM

All replies

  • Can you use Export/Import wizard from SSMS? BTW is it 64 or 32 bits?
    Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
    Wednesday, June 15, 2011 12:26 PM
  • Mi notebook is W7 64 bits

    I use VS 2010 and SQL 2008 in a Dell Inspiron 17 4 GB (upto 8 GB)

    Best Regards


    Wednesday, June 15, 2011 5:12 PM