sql script to read values from the excel sheet

  • hi

    i'm not sure whether it's possible, i have data in my excel sheet of which i need to create a script from my sql database and join the fields from my table with the one in my spreadsheet and read the data from the spreadsheet to a temp table.

    the reason i want to do this is because the database is protected and not allowed to create any new tables without going through certain channels to do that and it's a stress

  • Hi,

    u can use the following query to read data from a excel sheet.

    SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.5.0', 'Excel 8.0;DATABASE=d:\ABC.xls', 'Select * from [sheet1$]')

    Thanks

    Shailesh

  • More info

    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926


    Madhivanan

    Failing to plan is Planning to fail

  • thanks guys for responding.... i just had a look at it and i think it's what's i'm looking for

  • Nomvula (12/10/2008)


    hi

    i'm not sure whether it's possible, i have data in my excel sheet of which i need to create a script from my sql database and join the fields from my table with the one in my spreadsheet and read the data from the spreadsheet to a temp table.

    the reason i want to do this is because the database is protected and not allowed to create any new tables without going through certain channels to do that and it's a stress

    This[/url] article is a fantastic starting point.

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden

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

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