title: SQL Functions - Logging
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/586642/tsql-how-do-you-output-print-in-a-user-defined-function">TSQL How do you output PRINT in a user defined function?</a>  </p>
  </blockquote>
  
  
  
  <p>This is driving me crazy.</p>
  
  <p>I have a function I am trying to debug, but I can't insert into a table, execute a print statement, or even raise an error from it.</p>
  
  <p>SQL returns the message </p>
  
  <blockquote>
    <p>Invalid use of a side-effecting operator 'PRINT' within a function.</p>
  </blockquote>
  
  <p>How can I Debug this, I just want to know the value of a variable while it is running?</p>