Tuesday 3 December 2013

SQL Server STR Function and SPACE Function


STR() Function
This function returns character data converted from numeric data.
It takes 3 arguments. First argument as float data,second argument
as integer value specifying the length of the string including decimal
that is to be retrieved and third argument as integer specifying the
number of places to the right of the decimal point.

e.g: SELECT STR(123.45, 6, 1)

SPACE() Function
This function returns a string of repeated spaces.

e.g:select 'Hello'+Space(2)+'World'