Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Right Padding Function
Message
From
13/10/2003 11:01:54
 
 
To
12/10/2003 23:28:30
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00837989
Message ID:
00838113
Views:
12
>Hi folks!
>
>is there any example that describe Padding function for string/varchar
>similar to RPAD or LPAD function in Oracle?
>
>TIA

I just do this:

-- Pad left, length of 50, with spaces
RIGHT(space(50)+@myfield,50)

-- Pad left, length of 50, with zeros
RIGHT(replicate('0',50)+@myfield,50)

For padr you can do the same thing but use the left() function. I guess you could write UDF's to do this now.

BOb
Previous
Reply
Map
View

Click here to load this message in the networking platform