title: SQL server query : how to check value within range
body: <p>In application I am working on. </p>
  
  <p>I have to input from user through excel and first put it in temporary sql table &amp; then from temporary table to final target table.</p>
  
  <p>My query is failing while putting data from temporary table to target table.
  Because some values present in temporary table are out of range of columns in target table.</p>
  
  <p>How can I check if values present in temporary table are within range of column of target table?</p>
  
  <p>I have to check like this </p>
  
  <pre><code>20 &lt; len(temporary_table.column1) &lt; 50
  </code></pre>
  
  <p>or is there any better way</p>