title: Put bcp inside a transaction with another tsql statement
body: <p>After a bcp output command from tsql did its work (export a file) you generally want to cleanup the source afterwards.
  This typically involves truncating the source table or setting a flag that the records are indeed processed.</p>
  
  <p>If you don't clean up the next export will of course included the old and already exported rows.</p>
  
  <p>My experiments show that you cannot place a bcp inside a transaction. Its my assumption that it is an out of process tool and doesn't join the initiating transaction (correct me if I'm wrong please).</p>
  
  <p>The question is if its possible to have these 2 actions be performed as a <strong>unit of work</strong> in some other way? Either it fails together are they succeed together.</p>
  
  <p>I was hoping there was a "post action" that you could pass to bcp so that bcp itself could guarantee transaction like begaviour.</p>
  
  <p>Thanks for the ideas, Tom</p>