Import named range from excel

  • Hi. I am trying to import an named range from excel into sql but do not know how to using dts. I found this to run in query analzer, but doesn't work. Can anyone tell me if they've done this before?

    select *

    FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',

                    'Excel 8.0;HDR=YES;IMEX=2;DATABASE=\\city-fileserver\Shared\Technology Services\SQL Server\test.xls',

                    'SELECT * FROM [test]')

     

    It gives me the following error:

    OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error. The provider did not give any information about the error.

    OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IDBInitialize::Initialize returned 0x80004005:  The provider did not give any information about the error.].

    Thanks!

    Thanks!

  • Thanks anyway. I figured it out and it was actually pretty easy. I guess I was expecting it to be much more difficult. I basically created a dts package to grad the spreadsheet and then used a query to transfer only the named range I needed.

    Thanks!!

    Thanks!

  • Otherwise just put a $sign after the name for the sheet,

     

    [test$]

     


    N 56°04'39.16"
    E 12°55'05.25"

  • Thanks for the tip!

    Thanks!

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply