Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Values in a varchar field which was of size (6) use to appear as 001234 now it have been converted to(8)but they still are appearing 001234 i want it to appear as 00001234 and want to update those values directly
the column needed to update is set with constraint.

please help

UPDATE 1: OP want to update those values without using LEN or REPLICATE
Posted
Updated 1-Jul-10 20:09pm
v2
Comments
Sandeep Mewara 2-Jul-10 1:28am    
Keep patience. People will reply back when they are free.

Please dont delete the old same question and post as new next time!

1 solution

update table set field = lpad(field, 8, '0');
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900