The 2 parameters in function are
Collection of values separated by specified separator(the separator defined in second parameter)
The second parameter is separator of collection values.
The function returns
The max value in the collection, min value in the collection and number of values in the collection.
For example:
if we run this statement
select * from dbo.GetMaxandMinValue('2,22,5,1,88,2000,7897,800',',')
The result will be:
minValue maxValue CountOfNumberSupplied
--------------------------------------- ----------------------------
1.00 7897.00 8