title: bcp append a line at the end of file
body: <p>I am trying to export a .txt file with bcp:</p>
  
  <pre><code>EXEC xp_CMDSHELL 'BCP "SELECT v.ItemId
    , v.InventLocationId
    , CAST(v.AvailPhysical AS int)
  FROM D_R1.dbo.vwStockOnHand AS v 
  JOIN D_R1.DBO.vwProducts AS m 
  ON v.ItemId = m.ITEMID 
   WHERE  NOT EXISTS 
       (SELECT 1 
        FROM D_R1.DBO.ExportExcludedFamilies AS magExport 
        WHERE magExport.REFRECID = m.FamilyRecId) 
        AND  AVAILPHYSICAL &gt; 0 AND v.PICKFROMZ = 1 
        ORDER BY  v.InventLocationId, v.ITEMID"
        queryout "C:\temp\1.txt" -c -t"|" -T -S D_R1'
  </code></pre>
  
  <p>All good, but i would need a last line in the file like "END OF FILE" and i am not able to figure it out .. </p>
  
  <p>Can someone give me a hint on this?</p>