The goal is to strip all special characters from our customer's addresses.
We learned recently that having any special characters in any part of a customer's record goes against the Metro2 formatting required for credit reporting. I have over 200,000 customer accounts in my database, so going one at a time to clean up these accounts is not an option.
I have access to a live database and a training database. In the training database, the following query works just fine, but it does not work in the live database.
SELECT cus_acct, cus_name, cus_addr1, cus_addr2, cus_city, cus_st, cus_zip, cus_country
FROM sccust
WHERE cus_addr1 IS NOT NULL
AND cus_addr1 <> ' '
AND cus_addr1 LIKE '%*%'
--AND cus_addr1 LIKE '%.%'
--AND cus_addr1 LIKE '%,%'
--AND cus_addr1 LIKE '%''%'
--AND cus_addr1 LIKE '%:%'
UPDATE sccust
SET cus_addr1 = REPLACE(cus_addr1, '%#%', ' ');
Any help is greatly appreciated here!
Executing this query in a training system works perfectly. Simply changing to the live data set produces no results, even though the code has stayed the same.