title: SQL Server turn off ANSI_WARNING ON A stored procedure
body: <p>I need to know how to turn off ANSI warnings on my stored procedure please. I keep getting the error </p>
  
  <blockquote>
    <p><em>String or binary data would be truncated.</em></p>
  </blockquote>
  
  <p>However, I would rather this be turned off so as I expect this and would rather allow it. </p>
  
  <p>I added the statement </p>
  
  <pre><code>SET ANSI_WARNINGS OFF 
  GO
  </code></pre>
  
  <p>right before the stored procedure however, doing this does not seem to suppress the error at all. </p>
  
  <p>For the reason why I have this truncate error to begin with, well one of my stored procs executes dynamic Sql to retrieve values(<a href="http://sqlfiddle.com/#!3/10876/1" rel="nofollow">SQLFIddle showing the code</a> ). And I had to set the length on all of my fields to the length of the max (NVarchar(3072)). When my query is executed however, I need them back to the right size when printing them to the client. </p>
  
  <p>Would appreciate info on how to best deal with this please. Thanks in advance. </p>