Tuesday, March 27, 2012

Converting Data

Hi
I am converting data from old DB to NEW DB
In the OLD table fields like "PhoneNumber" the data enterd are [ 657 985-986, (03)-987-543, 675(89)00, ect]
Is their any function in sql where I can get rid of all those spaces and () and - between the numbers as my new field is only numbers and with out space
Otherwise I have to clean them up manually as I have 1000000 records

cheers

hi koese,

as far as i know there's no direct function to help you out during migration or converting. an alternative i think of is first you let your column type to be varchar in new db.

then after migrating run a update i know it will take time but that will definately work.

then you can use a command likeSELECT REPLACE('abcdefghicde','cde','xxx')

thanks,

satish.

sqlsql

No comments:

Post a Comment