title: excaping characters to run xp_cmdshell
body: <p>I know that I need to escape the @cmd var to run:</p>
  
  <pre><code>declare @cmd 'xp_cmdshell ''echo Mary|Warrior &gt; c:\test.txt'''
  exec (@cmd)
  </code></pre>
  
  <p>because the character '|' would fail when running the command.</p>
  
  <p>So, previous running I set:</p>
  
  <pre><code>set @cmd = replace(@cmd, '|', '^|')
  </code></pre>
  
  <p>As @cmd var could be any string (sent by users)... What other characters do I need to worry about ?</p>
  
  <p>(I know a couple of them such as >, &lt;)</p>