views:

45

answers:

3

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.

+2  A: 

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.

Ciaran Archer
It's easy enough to identify the states in the United States. But there are other geographic parts of the US which aren't "states". For example, Puerto Rico, Guam, US Virgin Islands. Even the District of Columbia. You'll want to be sure you have considered those as well.
DOK
i wanted the list of all countries, their states, cities everything, it would be easier if something like SQL file is available
GayaMani
I'm not sure if such a thing exists. Keeping it up to date would be a lot of work. If you do some Googling you'll find it for certain countries, for e.g: http://dpi.careerbuilder.com/Site/Geography/ListStateprovcounty.aspxYou might also be able to find some third parties that provide this data - but you'll most likely pay for it.
Ciaran Archer
A: 

http://tinyurl.com/2v6u87o

Andy_Vulhop
FYI, the link goes to a google search of "complete list of countries states cities sql"
KM
That's the point. I'm guessing you have never seen lmgtfy dot com? It's a sort of sarcastic site that you hand to people who could have googled something themselves instead of asking others to google it. This isn't a question about programing. This is a question about wanting someone else to hunt down and find a resource for them. That's fine if you have looked a little yourself. Teach a man to fish, right?
Andy_Vulhop
+1  A: 

Check the GeoNames http://download.geonames.org/export/

leon01