Hey,
I have a table that has about 400,000+ rows. I am writing some pattern matching code but need to clean up a column before I do so. This boils down to doing a replace-like operation.
I tried listing them all out one at a time...
Update T_ADDRESS set ADDR_LINEONE = REPLACE(ADDR_LINEONE,' southeast ',' se ')
Update T_ADDRESS set ADDR_LINEONE = REPLACE(ADDR_LINEONE,' southwest ',' sw ')
Since I have over 500 of these...it took too long.
Now I am trying to nest them...
Update T_ADDRESS set ADDR_LINEONE = REPLACE(REPLACE(ADDR_LINEONE,' southwest ',' sw '),' southeast ',' se ')
But this is still painfully slow. I need to make this code work on tables of all sizes (1 record to 5 million records).
Anyone have any advice? I am using SQL Server by the way.