Would like to write a Scalar Function that returns a variable length string of spaces.
Length being determined by an input parameter (int)
Maybe I am missing the obvious but it seems impossible because you have to declare the size of the varchar return variable
I know there is a performance hit using scalar functions but we are generating a view that emulates an old fixed file format with lots of unused fields.
So it will make the resultant view readable.
So I am looking to do select goodfield1,fnSpace(5) as Unusedfield1,goodfield2,fnSpace(10)... from MyView
View Complete Post