Solved

How to validate a physical address using MSSQL

Posted on 2010-09-03
2
253 Views
Last Modified: 2012-05-10
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!
0
Comment
Question by:horalia
  • 2
2 Comments
 
LVL 7

Accepted Solution

by:
bouscal earned 500 total points
ID: 33599823


WHERE NOT ISNUMERIC(LEFT(addressfield,1))

should pull any records that do not start with a digit.
0
 
LVL 7

Expert Comment

by:bouscal
ID: 33599952
EDIT:

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.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question