How to get Excel sheet A1 column value

  • Hi Guys.,

    How to get the excel file A1 column value, i tried query

    select * from [Sheet1$A1:A1] it's displaying the header column as the value

    please suggest to read the the file to A1 column in excel file.,Find the document same in the message

    Thanks

    Ranganathan

  • You can either do it in a script task (as it is only one single value), or you can create a named range into the excel file (that just contains A1) and then write your query using the named range as the table.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • It's not clear what you're trying to do. The topic you posted is "How to get Excel sheet A1 column value", which is ambiguous because in Excel, "A1" is a cell, and the column in which it's found is just "A". When you query all (with Select * ) a range [A1:A1], you're asking for all cells in that range. A1 would be the cell with the column header "Name" in your example. You say your query returned "the header column", which I presume to mean the header for the column, the word "Name". This makes sense as A1 is the ONLY cell in the range A1:A1 that you specified.

    I'd suggest that if you want to get the list of names ('ABC', 'ABC', 'ABC'....), that you check the box in the Excel connection manager to say that the first row has column names and then simply query "Select Name from [Sheet1$]".

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

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