Hi In a application i need to list all countries in the world , we i select a country all the states corresponding to it should be listed, if i select as state all the cities in that state should listed.
I have created the tables with references in SQL Server 2005.
I need the complete data list of countries , states, cities Is there any solution or packages or files available so that we can import to SQL Server.
ISO country codes are here. You can download this in a number of formats (CSV etc) and using DTS or a similar product you ought to be able to import them into your database.
Once you get down to states or regions in countries it gets bit trickier. You may have to put these together yourself, or search for individual resources that provide them.
EDIT:
I found the US States here, in MySQL format - which you can probably easily adapt.
As leon01 said you can use GeoNames.
I did a small tool to generate an XML file based on the output of their webservices: https://github.com/yosoyadri/GeoNames-XML-Builder
All credit should really go to the C# library at http://geonamesdotorgdotnet.codeplex.com/ that I'm using to parse the response XML from the services.
You have an already made list of countries and provinces from this service at https://raw.github.com/yosoyadri/GeoNames-XML-Builder/master/continents-countries-statesprovinces.xml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With