title: sqlcmd with output file and screen output
body: <p>I do some command line batch (.bat) with sqlcmd as this way:</p>
  
  <pre><code>sqlcmd -i Scripts\STEP01.sql -o PROCESS.log -S MYSERVER -E -d MYDATABASE
  </code></pre>
  
  <p>and i need an output file (it's works currently) and also the output trought the screen to do something like:</p>
  
  <pre><code>@echo off
  echo The result of the query was:
      sqlcmd -i Scripts\STEP01.sql -o PROCESS.log -S MYSERVER -E -d MYDATABASE
  pause
  CHOICE /C:YN /M "Is the result accord?"
  IF ERRORLEVEL 2 GOTO ENDWITHERROR
  IF ERRORLEVEL 1 GOTO STEP2
  </code></pre>
  
  <p><strong>Note</strong>: </p>
  
  <ul>
  <li>Yes, the script works suscefull, it's not an issue question.</li>
  <li>And yes, I've a "print "something" on my sql. The log file gets the output.</li>
  </ul>
  
  <p>Thanks a lot!</p>
  
  <p>Similar question without answer:
  <a href="https://stackoverflow.com/questions/9165319/how-to-run-a-sql-script-file-using-sqlcmd-and-output-to-both-shell-and-file">How to run a sql script file using sqlcmd and output to both shell and file</a></p>