Mass update of data in sql from int to varchar

Posted by Christopher Kelly on Stack Overflow See other posts from Stack Overflow or by Christopher Kelly
Published on 2010-03-19T19:04:15Z Indexed on 2010/03/19 19:21 UTC
Read the original article Hit count: 247

Filed under:
|

we have a large table (5608782 rows and growing) that has 3 columns Zip1,Zip2, distance

all columns are currently int, we would like to convert this table to use varchars for international usage but need to do a mass import into the new table convert zip < 5 digits to 0 padded varchars 123 becomes 00123 etc. is there a way to do this short of looping over each row and doing the translation programmaticly?

© Stack Overflow or respective owner

Related posts about sql

Related posts about formatting