SELECT based on ordinal position unknown column names. NO SYS query

  • Ok I have as a linked server an Excel workbook.

    The tabs (Tables) are dynamic and unknown but I am now getting those.

    The columns are dynamic as well. If I select the top row with header OFF I get my first row of data is the column names.
    * The first column is always NULL (With headers on it works). - I will deal with that.

    Now I am trying to select the columns by position because I will not know the names. The built in procedure that returns this information does not function. I read somewhere it has a bug. Regardless for tabs (tables) and columns no results returned.

    Is there a way to accomplish TWO things.

    1 get the NUMBER of columns in the excel spreadsheet and two query by ordinal position?

    I can then build a dynamic query that will loop say 10 times if their are 10 columns and build a SELECT. I will bring the column names into a SQL Variable table and then pivot that bad boy and create the rest of the logic I need.

    <hr noshade size=1 width=250 color=#BBC8E5> Regards,Jeffery Williams http://www.linkedin.com/in/jwilliamsoh

Viewing 0 posts

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