Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What in TSQL is comparable to padl() function in VFP?
Message
From
13/06/2001 12:23:27
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00518637
Message ID:
00518954
Views:
12
You can try the REPLICATE function. Here is a sample where in this case the pad character is '0' and the overall length is 5.

SET @nextjobid = REPLICATE('0',5 - LEN(LTRIM(@nextjobid))) + LTRIM(@nextjobid)

HTH
John

>I have a varchar field that needs padding to allow proper ordering and checking for duplicates.
>
>Is there a command to pad zeroes onto a string?
>
>TIA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform