Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


SQL Address Parsing Routine

SQL Address Parsing Routine

SQL Address Parsing Routine

Does anyone know of a SQL address parsing tool or have code for parsing address data. For Example: 100 West Main St. parsed into 3 separate variables Street Number, Street Name, and Street Type.

I need this for an inhouse project where we need to match incoming patient data from many different sources to our data by using first name, last name, address, city, state, and zip. Because the data comes in from many different sources it is never exactly the same and therefore I must score each element to get an overall confidence score to determine the correct inhouse record which matches.

Any help with this would be greatly appreciated.


RE: SQL Address Parsing Routine

   If I had a nickle for every time... Thread183-948580 is the most recent.  It's a combination of SQL and manual updates.  Work right to left, one field at a time.  Update the data and check the results by sorting the data on the updated field.  Find errors and correct manually.

Cursors, triggers, user-defined functions and dynamic SQL are an axis of evil!
Life's uncertain...eat dessert first...www.deerfieldbakery.com

RE: SQL Address Parsing Routine

Well Donutman I would happily give you a dollar for a good parsing script that takes into account that the address does not come in any specified format. It could be 100 W. Main St, P.O. Box 100, 100 West Main Street Apt. 10, etc. That is my true battle which I guess was not properly specified in my original post. I must parse these addresses and attempt to match as many elements as possible to determine the correct match.

I do thank you for your initial reply and again any help or a point in the right direction would sure save me a lot of headaches.


RE: SQL Address Parsing Routine

   Only you can come up with the appropriate algorithm based upon the data.  Because of the many ways that the data can be stored, I seriously doubt that there is a swiss army address parser out there.  
   It is a PITA job that requires time and ingenuity.  But if it were my job, I would parse (as I said) from the right to the left using T-SQL on a mass basis.  First I would try to get the zip codes, store that field and examine the results.  Fix them and move on to the next item, usually State.
   If the addresses are as randomly formated as you just posted, I'd consider sending the data to India.
   Sorry, but that's the best I can offer.

Cursors, triggers, user-defined functions and dynamic SQL are an axis of evil!
Life's uncertain...eat dessert first...www.deerfieldbakery.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close