I have written a stored procedure to pull info about files from another server that is not a db server. In the proc is this code:
SET @vchCMD = 'dir \\server_name\folder_name\ /b /s';
INSERT INTO #DirList
exec master..xp_cmdshell @vchCMD;
When I run this code on the db server itself it works. When I use the path to a folder on another server I get the error "access denied". Anyone know why? What to do to resolve?