>Hi folks! > >is there any example that describe Padding function for string/varchar >similar to RPAD or LPAD function in Oracle? > >TIA
There're no built-in functions like that. It can be done using other functions or there combinations.
-- Right pad 'myfield' to the lenghth 20SELECTCAST(myfield aschar(20))
-- Left pad 'myfield' to the lenghth 20SELECTREPLICATE(SPACE(1), 20 - DATALENGTH(@myfield)) + @myfield