title: XP_DirTree in SQL Server
body: <p>Variations to this have been asked. I have no problem searching a local directory with the below piece of code.</p>
  
  <pre><code>EXEC MASTER.sys.xp_dirtree 'C:\', 1, 1
  </code></pre>
  
  <p>When I switch the path to a network location the results are empty.</p>
  
  <pre><code>EXEC MASTER.sys.xp_dirtree '\\Server\Folder', 1, 1
  </code></pre>
  
  <p>I first thought maybe it was something to do with permissions. I added the SQL Server Service to the ACL list on the shared volume as well as the security group.</p>
  
  <p>Any help or direction to point me in is greatly appreciated or even another way to get a list of files in a directory and sub directories.</p>
  
  <p>[Edited]</p>