Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Add prefix '0' to the column value
Message
 
 
À
30/09/2017 23:46:15
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01654668
Message ID:
01654701
Vues:
49
>>
>>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)
>
Thank you, Kevin. This is almost exactly what I used. I found it online.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform