Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add prefix '0' to the column value
Message
From
30/09/2017 23:46:15
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01654668
Message ID:
01654699
Views:
53
>
>How do I do it in T-SQL in one UPDATE?
>
>TIA


There might be more recent ways to do this, but here's how I always do it...
UPDATE TestTable SET TestColumn = RIGHT('0000' + TestColumn,4)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform