When running xp_dirtree, it does not seem to read some directories.
Any suggestions? I am wondering if it is some sort of permission kind of thing? While my question has been flagged as a possible duplicate of another question, that question is indecipherable to me - I have no idea what it is actually telling me to do to fix the problem.
I am running Windows 10 and using Microsoft SQL Server 2014
USE MyDatabase;
DECLARE @files TABLE (FileName varchar(max), depth int, IsFile int)
--INSERT INTO @files EXEC xp_dirtree 'C:\', 1,1 -- works
--INSERT INTO @files EXEC xp_dirtree 'C:\Temp' , 1,1 -- does not list anything
--INSERT INTO @files EXEC xp_dirtree 'C:\Users' , 1,1 --works
--INSERT INTO @files EXEC xp_dirtree 'C:\Users\Default' , 1,1 --Works
--INSERT INTO @files EXEC xp_dirtree 'C:\Program Files\Microsoft SQL Server\', 1,1 --works
--INSERT INTO @files EXEC xp_dirtree 'C:\Users\Donald' , 1,1 --Does not list anything