Returns a table containing the names and index numbers of the worksheets in a particular Excel workbook. The workbook
may be in
.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.
- file-path (string)
The absolute path of the
.XLSXworkbook to inspect.
A table with the following columns:
Column name Description Example value
1-based index 1
Worksheet name "Sheet1"
SELECT * FROM LIST_XLS_WORKSHEETS('C:\Workbook.xls');
Returns a table listing all the worksheets in the "Workbook.xls" file.
SELECT name FROM LIST_XLS_WORKSHEETS('C:\Workbook.xls') WHERE number = 2;
Returns the name of the second worksheet in "Workbook.xls", or an empty table if there are fewer than 2 worksheets in the workbook.