Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Address Parsing Routine

Status
Not open for further replies.

Dishman

Programmer
Joined
Dec 9, 2004
Messages
2
Location
US
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.

Thanks,
Dish
 
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.
-Karl

[red] Cursors, triggers, user-defined functions and dynamic SQL are an axis of evil![/red]
[green]Life's uncertain...eat dessert first...www.deerfieldbakery.com[/green]
 
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.

Dish
 
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.
-Karl

[red] Cursors, triggers, user-defined functions and dynamic SQL are an axis of evil![/red]
[green]Life's uncertain...eat dessert first...www.deerfieldbakery.com[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top