Help SQL GODS

  • Somebody sent me an excel file. I want to take data from that file and insert it into a temp table in SQL.

    I was doing some reading and come to the conclusion that I have to use OPENDATASOURCE or OPENROWSET

    I am not familar with these commands.

    Can somebody please help this grasshopper?

    Hopefully you can provide some code

    lets assume this:

    The file resides in C:\

    The file has 1 column text which needs to be inserted into a temp table in SQL server 2000

    I think i provided sufficient information.

  • Thanks for the quick reply noel

    wanna double check that link?

  • http://www.databasejournal.com/features/mssql/article.php/3331881

    I don't know what happen use Copy + Paste of the above in your browser


    * Noel

  • Looks Like a bug in SSC code 😀


    * Noel

  • noeld,

    It looks like there may have been an issue in the "HTML/TEXT" editor. For links, bold, underline functionality... etc., you actually have to write it using HTML. Previously, about two days ago, I can just put a link on there and it would work.

    I believe this change just happened since two days ago.

    Regards,

    Wameng Vang

    MCTS

  • hey,

    the article is fine but my scripting is beginner

    I'm getting syntax errors

    can i perform a select into with openrowset?

    the name of the file is abc.xls in C:

    what i want to say is

    select *

    FROM OPENROWSET('SQLOLEDB','c:\abc.xls') <~~~~this is clearly wrong can somebody help?

    INTO temp table

  • SELECT * Into #temp

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

    'Data Source="c:\abc.xls";

    User ID=Admin;Password=;Extended properties=Excel 8.0')...Sheet1$

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

Viewing 8 posts - 1 through 7 (of 7 total)

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