read .xlsx files

arkiboys 9,706 Reputation points
2021-09-23T10:54:55.983+00:00

Hello,
In the serverless sqlpool I have created views to read .csv files using openrowset, etc.
How is it possible to read a .xlsx file?

I tried something like this but it is not correct
SELECT *
FROM OPENROWSET(
BULK 'Input/file.xlsx',
DATA_SOURCE = 'xyz',
FORMAT = 'Excel',
HEADER_ROW = TRUE
)
AS [r]

Thank you

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,582 questions
0 comments No comments
{count} votes

Accepted answer
  1. HimanshuSinha-msft 19,486 Reputation points Microsoft Employee Moderator
    2021-09-23T23:39:07.16+00:00

    Hello @arkiboys
    Thanks for the ask and using Microsoft Q&A platform . Read more here

    With OPENROWSET excel is not not a supported file type .

    Important points from the doc .

    Arguments
    You have two choices for input files that contain the target data for querying. Valid values are:
    'CSV' - Includes any delimited text file with row/column separators. Any character can be used as a field separator, such as TSV: FIELDTERMINATOR = tab.
    'PARQUET' - Binary file in Parquet format
    'DELTA' - A set of Parquet files organized in Delta Lake (preview) format

    Thanks
    Himanshu

    -------------------------------------------------------------------------------------------------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.