SyntaxFix
Write A Post
Hire A Developer
Questions
You can use xp_dirtree
It takes three parameters:
Path of a Root Directory, Depth up to which you want to get files and folders and the last one is for showing folders only or both folders and files.
EXAMPLE: EXEC xp_dirtree 'C:\', 2, 1
EXEC xp_dirtree 'C:\', 2, 1