SQL update statement based on a formula?

in my table PostalCodes i need to select all Postalcodes from dbo.postalcodes where LEN = 4, and then add a leading 0 (zero) in front of value and re-update it.

For example, postal codes in the table that look like this:  7712  should actually be 07712

Anyone know how to do this?
arthurh88Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Kyle AbrahamsConnect With a Mentor Senior .Net DeveloperCommented:
update postalcodes
set postalcode = '0' + postalcode
where len(postalcode) = 4
0
 
arthurh88Author Commented:
bah!  i should have figured this one out :)  Thanks!!
0
All Courses

From novice to tech pro — start learning today.