title: Output SQL messages to a Log File
body: <p>I have an SQL script than runs a couple of DBBC commands. Is there a way to send the messages generated from executing these commands to a simple log file e.g "C:\log.txt"?</p>
  
  <p>The messages I mean are the ones that appear in the messages box at the bottom of SQL Server 2005 Management Studio after a query has executed.</p>
  
  <p>The reason for needing to do this is because I don't intend on having SQL Server Management Studio open so the messages can't be seen.</p>
  
  <p>I am using SQL Server 2005 if that helps.</p>