SQL Server Performance

reading excel sheet through OPENROWSET

Discussion in 'SQL Server 2005 General Developer Questions' started by jsrchennai, Nov 28, 2007.

  1. jsrchennai New Member

    Hi All!

    I used the the following statement to read excel sheet.
    But I am getting the error

    SELECT *
    FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
    'Excel 8.0;Database=D: asksduplicates.xls;IMEX=1',
    'SELECT * FROM [Sheet1$]')

    ----------------------------------
    Server: Msg 7399, Level 16, State 1, Line 1
    The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. The provider did not give any information about the error.
    Server: Msg 7303, Level 16, State 1, Line 1
    Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".
  2. Madhivanan Moderator

  3. deepu_v04 New Member

    sp_configure 'show advanced options', 1
    RECONFIGURE
    GO
    sp_configure 'Ad Hoc Distributed Queries', 1
    RECONFIGURE
    GO

    SELECT * into CountryList
    FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
    'Excel 8.0;Database=D: asksduplicates.xls;',
    'SELECT * FROM [sheet1$] where Col_Name is not null')



    Make sue that the excel sheet is not opened and file exists in the server and not at the clien

Share This Page