开发者

Country, state list for SQL Server [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendatio开发者_Python百科ns for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 7 years ago.

Improve this question

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜