Getting maximum value of float in SQL programatically
- by Axarydax
Is there an method for programatically (in T-SQL) retrieving the maximum (and minimum) value of a datatype? That it would act like float.MaxValue in C#.
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
declare @min float
declare @max float
/*fill @min and @max, can be null if undefined*/
select * from foo
where bar between isnull(@min,0 ), isnull(@max,max(float)/*magic*/)
Thanks