title: xp_fileexist with IF EXISTS
body: <p>I'm currently attempting to create a stored procedure that checks to see if a file is there, and if so it then runs some more code, if not. It stops. </p>
  
  <p>So am using <code>exec master..xp_fileexist @FileName</code>    </p>
  
  <p>This returns</p>
  
  <pre><code>File Exists| File is a Directory| Parent Directory Exists
            1|                   0| 1
  </code></pre>
  
  <p>I can't figure out the syntax or set up for putting the stored proc into a <code>IF EXISTS</code> statement</p>
  
  <pre><code>IF EXISTS (
            exec master..xp_fileexist @FileName
  
            )
  
  BEGIN 
  select 'File is there'
  END
  ELSE
  BEGIN
  select 'File is not there'
  END
  </code></pre>
  
  <p>The above doesn't work, can anyone put me on the right path?</p>