title: Suppress tempdb message when outputting result set
body: <p>Using <code>SQLCMD</code>, I am running a script to output to <code>STDOUT</code> then gziping the output.  When I look at the output file, I see this warning message:</p>
  
  <p><code>Database name 'tempdb' ignored, referencing object in tempdb.</code></p>
  
  <p>In my script, I have a check at the start of the script to drop the temp table if it exists:</p>
  
  <pre><code>IF OBJECT_ID('tempdb..#TheTable') IS NOT NULL
  BEGIN
      DROP TABLE tempdb..#TheTable
  END
  </code></pre>
  
  <p>However - I have also <code>SET NOCOUNT ON</code>, but file still captures the warning message. </p>
  
  <p>SQLCMD Script:<br>
  <code>sqlcmd -i TheScript.sql -h-1 -k1 -s"," -W -u | gzip &gt; "C:\TheOutput.gz"</code></p>
  
  <p>Is there a way to suppress a message like that?</p>