Results 1 to 2 of 2

Thread: select help...

  1. #1
    Join Date
    May 2003

    Unanswered: select help...

    I need to connect to an excel spreadsheet from SQL Server. I used this statement to create the new server called ExcelSource..

    EXEC sp_addlinkedserver 'ExcelSource', 'Jet 4.0', 'Microsoft.Jet.OLEDB.4.0', 'c:\dt.xls', NULL, 'Excel 5.0'
    EXEC sp_addlinkedsrvlogin 'ExcelSource', 'false', 'sa', 'Admin', NULL

    This says the server is created but now I want to select info from a datarange in this spreadsheet. The books online says to use

    SELECT *
    FROM ExcelSource..Quarter(Quarter being the datarange)

    but when I try to execute I get the error...

    Server: Msg 7314, Level 16, State 1, Line 4
    OLE DB provider 'ExcelSource' does not contain table 'Quarter'. The table either does not exist or the current user does not have permissions on that table.
    OLE DB error trace [Non-interface error: OLE DB provider does not contain the table: ProviderName='ExcelSource', TableName='Quarter'].

    I am kind of new with this so I am not sure what the problem is??? Is the select set up wrong??? any suggesstions?

  2. #2
    Join Date
    Jan 2003
    that really shouldn't be done....Excel isn't a database, nor should it be treated as one. The easiest thing to do would be to import the excel spreadsheet into sql server using DTS.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts