Solved

How to validate a physical address using MSSQL

Posted on 2010-09-03
2
232 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
Comment Utility


WHERE NOT ISNUMERIC(LEFT(addressfield,1))

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

Expert Comment

by:bouscal
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now