Can someone give me a script please

Sep 26, 2007 2 Replies

Hi Could someone give me a script to do the following please?



In the Customer table there are over 500 records. Most of them have 3 digit numbers eg 423 The last 50 or so have 6 digit numbers eg 000475 I want to change all the 3 digit ones to add 3 leading 0's to the number ie to make 423 into 000423



Thanks


Gaz, This should get you were you wanna go:

UPDATE Customer SET AccountNumber = '000' + AccountNumber WHERE LEN(AccountNumber) = 3

Thanks for that Ryan.

Simple when you know how! :)

"Ryan @ RITE" wrote:

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required