SQL Notebook (logo)

LIST_FILES Function

Returns a table containing the files in a particular folder, optionally recursing into subfolders. If a folder cannot be accessed, then it is skipped silently. This function is used in the FROM clause of a SELECT statement and can participate in JOINs as if it were a table.

Syntax

LIST_FILES(root-path, [recursive])

Arguments

Return Value

A table with the following columns:
Column name Example value
file_path "C:\Temp\file1.csv"
folder "C:\Temp"
filename "file1.csv"
extension ".csv"
modified_date "2016-04-03 22:05:14.790 -04:00"

Examples