title: Alternatives to hard coding values in stored procedures SQL Server 2008R2
body: <p>I want to avoid modifying stored procedures when users request to add/remove numbers (1, 2, 5, etc.).  I thought about adding data table that would hold these values.</p>
  
  <p>Issue with data table:  Individual numbers work great with data table, but when I'm dealing with a range of numbers, I am not able to figure out ideal solution for it that is easy to maintain and great performance.</p>
  
  <p>Example of account numbers in where clause:</p>
  
  <ul>
  <li>Between 0 and 39000 </li>
  <li>Between 80000 and 80299 </li>
  <li>46000 (add only one number)</li>
  <li>2801  (add only one number)</li>
  </ul>
  
  <p>Example of my WHERE Clause:</p>
  
  <pre><code>WHERE
  (
  Account.Account  BETWEEN  '00000'  AND  '39999'
  OR Account.Account BETWEEN '80000' AND  '80299'
  OR Account.Account IN ('46000')
  OR Account.Account IN ('02801')
  )
  </code></pre>