Solved

How to validate a physical address using MSSQL

Posted on 2010-09-03
2
276 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Following an example - removing duplicate strings 4 70
Unable to save view in SSMS 21 83
Error in SSIS while executing  - Potential data loss 4 42
denied execute as 13 57
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…
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

752 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