I have a list of files in multiple folders in F:\ClientData\DocumentsTEST\guidsTest
This query gives me a full filepath for each file in a single column:
EXEC xp_cmdshell 'dir F:\ClientData\DocumentsTEST\guidsTest /b /s /a-d'
This query gives me attributes, but without the fullpath
EXEC xp_cmdshell 'dir F:\ClientData\DocumentsTEST\guidsTest /s /o /-c /a-d'
In the second case I could parse the data into separate columns based on string position, but that doesn't solve my problem.
What I need is the FullPath and the rest of the parameters returned by the SAME QUERY.
I tried running 2 separate bcp queries and then matching the fullpath based on filename, but filenames can be repetitive - so can't use that solution.
Can anyone help me please?