Where can I find a list of the US States in a form for importing into my database?
SQL would be ideal, otherwise CSV or some other flat file format is fine.
Edit: Complete with the two letter state codes
Where can I find a list of the US States in a form for importing into my database?
SQL would be ideal, otherwise CSV or some other flat file format is fine.
Edit: Complete with the two letter state codes
I needed this a few weeks ago and put it on my blog as SQL and Tab Delimited. The data was sourced from wikipedia in early January so should be up to date.
US States: http://www.john.geek.nz/index.php/2009/01/sql-tips-list-of-us-states/
I use the Worlds Simplest Code Generator if I need to add columns or remove some of the fields - http://secretgeek.net/wscg.asp
I've also done Countries of the world and International Dialling Codes too.
Countries: http://www.john.geek.nz/index.php/2009/01/sql-tips-list-of-countries/
IDC's: http://www.john.geek.nz/index.php/2009/01/sql-tips-list-of-international-dialling-codes-idcs/
Edit: New: Towns and cities of New Zealand
Out of interest: As there are only 50 and they rarely change, couldn't you not just manually create such a list from a source and put it on a public webspace?
Cut/Paste these into notepad and then import..should be easy enough - there are only 50 after all:
Alabama
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
Florida
Georgia
Hawaii
Idaho
Illinois
Indiana
Iowa
Kansas
Kentucky
Louisiana
Maine
Maryland
Massachusetts
Michigan
Minnesota
Mississippi
Missouri
Montana
Nebraska
Nevada
New Hampshire
New Jersey
New Mexico
New York
North Carolina
North Dakota
Ohio
Oklahoma
Oregon
Pennsylvania
Rhode Island
South Carolina
South Dakota
Tennessee
Texas
Utah
Vermont
Virginia
Washington
West Virginia
Wisconsin
Wyoming
Depending on why you need the states, it is worth keeping in mind that there are more than 50 valid state codes. For someone deployed outside the USA, it is annoying to come across websites that do not allow address entry with perfectly valid state codes like AE and AP. A better resource would be USPS (http://www.usps.com/ncsc/lookups/usps_abbreviations.html).
cheers, jason
http://www.geonames.org/export/
The GeoNames geographical database is available for download free of charge under a creative commons attribution license. It contains over eight million geographical names and consists of 6.5 million unique features whereof 2.2 million populated places and 1.8 million alternate names. All features are categorized into one out of nine feature classes and further subcategorized into one out of 645 feature codes. (more statistics ...). The data is accessible free of charge through a number of webservices and a daily database export.
You could use google sets to make a list of all states as well as lists of more or less anything.