Viewing directory of a mapped drive
1
vote
0
answers
1372
views
I'm using the following query to view files/folders in a given directory. It works locally, but when trying to view a mapped drive I get...
"The system cannot find the path specified."
I have the permissions for the whole mapped drive set to the service account associated with SQL, but it is still not working.
declare @files table (ID int IDENTITY, FileName varchar(100))
insert into @files execute xp_cmdshell 'dir Z:\ /b'
select * from @files
End goal is to create a stored procedure that will transact specific file names into a table.
Asked by duckfeet23
(11 rep)
Jul 15, 2018, 03:39 PM