title: How to catch exception in BCP process in SQL Server 2008?
body: <p>I am using bcp in SQL Server 2008.</p>
  
  <p>In some text file there is an error in data type so I am getting error message in output result but this is not raising any exception in catch block</p>
  
  <p>sample:</p>
  
  <pre><code>set @cmd='BCP In'
  declare @xpcmdResult int
  EXEC @xpcmdResult=xp_cmdShell @cmd 
  </code></pre>
  
  <p><code>@xpcmdResult</code> should result o or 1 based upon the bcp process success</p>