Adding Leading zeros - TSQL

The way to add 0 (zeros) to the left hand side of your number in T-SQL by

replace(space(2-len(co_num))+rtrim(convert(char(2), co_num)),' ','0') ,

where co_num is numeric data type

Comments

Popular posts from this blog

Network Intrusion Detection using Supervised ML technique

Common mistakes by Interviewer

Keep the system active, to avoid the auto lock