Link to home
Start Free TrialLog in
Avatar of Dnx_7
Dnx_7Flag for Belgium

asked on

How to fill zero in the left to get a varchar(10)?

Hi experts,

i would like to fill a varchar(10) with "0"

eg i have this varchar : "123"

so i would like to create such a string : "0000000123"

can you help me?

regards
Avatar of Aneesh
Aneesh
Flag of Canada image

SELECT RIGHT ('0000000000'+@urVriable, 10)
ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dnx_7

ASKER

thank you, very nice solution!