>Sergey's solution is much simpler. Thanks anyway.
>
It is for the particular case. But I'm not 100% sure it's the correct one.
How would the SQL determine the width of the column for UDF? With the suggested solution it leaves a room for ambiguity.
Also what if UDF returns values of different types?
If it's not broken, fix it until it is.
My Blog