SQL Notebook (logo)

LIST_XLS_WORKSHEETS Function

Returns a table containing the names and index numbers of the worksheets in a particular Excel workbook. The workbook may be in .XLS or .XLSX format. This is a table-valued function that can be used in the FROM clause of a SELECT statement and can participate in JOINs as if it were a table.

Syntax

LIST_XLS_WORKSHEETS(file-path)

Arguments

Return Value

A table with the following columns:
Column name Description Example value
number 1-based index 1
name Worksheet name "Sheet1"

Examples