Link to home
Start Free TrialLog in
Avatar of Lia Nungaray
Lia NungarayFlag for United States of America

asked on

How to validate a physical address using MSSQL

What would be a good way to check mailing addresses using MSSQL? The table I am working with currently has 1,448,634 entries, I would at least try to get addresses that don't start with a number... Thanks!
Avatar of Tim Bouscal
Tim Bouscal
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

If you want to check for PO boxes as well you could try;

WHERE ISNUMERIC(LEFT(address,1)) = 0
AND LEFT(address,3) NOT IN ('POB','P.O','P O','PO ')

I just tested this on a Northwind db and it worked well.