Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2003
    Posts
    223

    Unanswered: How to select data from Excel table by original column order?

    Hello, everyone:

    I have an Excel table that has columns like,

    Vendoe_Name
    Level
    Address
    Email
    Phone

    I use the statemen

    SELECT * FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',
    'Data Source=C:\test.xls;Extended Properties=Excel 8.0')...[Sheet1$]

    and got output by column order,

    Address
    Email
    Level
    Phone
    Vendoe_Name

    How to make output by original column order like,

    Vendoe_Name
    Level
    Address
    Email
    Phone

    Any help will appreciated. Thanks

    ZYT

  2. #2
    Join Date
    May 2005
    Posts
    48
    SELECT Vendor_Name, Level, Address, Email, Phone FROM
    OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',
    'Data Source=C:\test.xls;Extended Properties=Excel 8.0')...[Sheet1$]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •