title: Getting maximum value of float in SQL programmatically
body: <p>Is there an method for programmatically <em>(in T-SQL)</em> retrieving the maximum (and minimum) value of a datatype? That it would act like <em>float.MaxValue</em> in C#.</p>
  
  <p>I would like to use it in some selection when the parameter does not equal any actual values in the database, so I would use something like</p>
  
  <pre><code>declare @min float
  declare @max float
  --fill @min and @max, can be null if undefined
  select * from foo 
    where bar between isnull(@min,0 ) and isnull(@max,max(float)/*magic*/)
  </code></pre>