Hello XYZ,
You can use master.sys.xp_dirtree stored procedure to achieve this. This procedure takes following parameters
- Directory - The full path of the directory to be scanned
- depth - Number of how many subfolder levels to traverse. The default of 0 will display all subfolders.
- file - A value to enable a file or folder display. The default of 0 will not display any files.
Please have a look at
this[
^] or
this[
^] articles related to this procedure.
Regards,