Home Forums SQL Server 7,2000 General How to right-align a text column - SQL Srv 2000 RE: How to right-align a text column - SQL Srv 2000
Andras Belokosztolszki
SSC-Insane
Points: 21971
More actions
December 3, 2007 at 5:41 am
#756424
You could try to add spaces as a prefix, and then take the rightmost n characters, e.g.:
selectright(space(10) + rtrim('hi'), 10)
union all
selectright(space(10) + rtrim('hello'), 10)
The result is:
----------
hi
hello
Regards,
Andras