title: SQL Server equivalent of UTL_FILE.putline
body: <p>I'm trying to convert an Oracle function to SQL Server 2012.  My Oracle experience is very limited and I've came across something that SSMA couldn't convert automatically and I'm not sure what the SQL Server equivalent is.</p>
  
  <pre><code>UTL_FILE.put_line ( g_hFile, '    -&lt;&gt; &lt;calling&gt;: FN_STREAM.');
  </code></pre>
  
  <p>I've read that you can replicate some of the UTL_FILE functionality by using XP_Cmdshell but I'm really not sure where to go with this.</p>
  
  <p>Hope someone can help or point me in the right direction.</p>
  
  <p>Thanks</p>
  
  <p>Alex</p>