Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Right Padding Function
Message
De
13/10/2003 11:01:54
 
 
À
12/10/2003 23:28:30
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00837989
Message ID:
00838113
Vues:
13
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform