title: How to run bcp commands one by one
body: <p>i want to execute 15 "bcp commands" one by one in only one single batch file/script..
  Every command should process or execute only after previous command was successfully executed..
  if in any case a command fails to execute..the script should be stop execution...</p>
  
  <p>i tried this..but i didn't get sufficient output what i need..</p>
  
  <pre><code>bcp.exe "select * from OrderXpress.dbo.Customers where CustId &lt; 1000" queryout "D:\Customer.dat" -S localhost -U sa -P Sa12345 -E -n  
  
  IF %ERRORLEVEL% &gt; 0 ( PAUSE )
  
  bcp.exe OrderXpress.dbo.Customers out "D:\Customer2.dat" -S localhost -U sa -P Sa12345 -E -n 
  
  IF %ERRORLEVEL% &gt; 0 ( PAUSE )
  
  bcp.exe OrderXpress.dbo.Orders out "D:\Orders.dat" -S localhost -U sa -P Sa12345 -E -n 
  
  IF %ERRORLEVEL% &gt; 0 ( PAUSE )
  </code></pre>