Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kevmorelli/country-region-city-mssql
A database of all the countries,regions and cities in the world for Microsoft SQL Server
https://github.com/kevmorelli/country-region-city-mssql
asp-net dotnet microsoft mssql mssql-database sql
Last synced: about 1 month ago
JSON representation
A database of all the countries,regions and cities in the world for Microsoft SQL Server
- Host: GitHub
- URL: https://github.com/kevmorelli/country-region-city-mssql
- Owner: KevMorelli
- License: mit
- Created: 2018-05-31T14:00:25.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-10-15T03:23:37.000Z (about 4 years ago)
- Last Synced: 2024-10-12T07:21:27.797Z (about 1 month ago)
- Topics: asp-net, dotnet, microsoft, mssql, mssql-database, sql
- Language: TSQL
- Homepage:
- Size: 71.2 MB
- Stars: 40
- Watchers: 3
- Forks: 26
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Country-Region-City MSSQL ready-to-use scripts
## Description
This is an adaptation from MySQL to MSSQL.
Original scripts:
https://github.com/prograhammer/countries-regions-cities## Installation
- Open Visual Studio SQL Server Object Explorer or Microsoft SQL Server Management Studio
- Create a database with the name you want and select it
- Execute the scripts in the order that they appear (cities insert will take a few minutes)## Data Structure
### Countries table
- 230 records
| Column | Type | Description |
| ------------- |:---------------------------------------------| :--------------------------------|
| Id | SMALLINT(5) UNSIGNED NOT NULL AUTO_INCREMENT | Primary Key for a Country |
| Name | VARCHAR(255) NOT NULL | Country name |
| Code | VARCHAR(2) NOT NULL | Country abbreviation/ISO code |
| Language | VARCHAR(3) NOT NULL | Language code |### Regions table (regions/provinces/states)
- 3,884 records
| Column | Type | Description |
| ------------- |:---------------------------------------------| :--------------------------------------|
| Id | INT(11) UNSIGNED NOT NULL AUTO_INCREMENT | Primary Key for a Region |
| Name | VARCHAR(255) NOT NULL | Region name |
| CountryId | SMALLINT(5) UNSIGNED NOT NULL | Foreign key to Countries table |### Cities table
- 2,778,165 records
| Column | Type | Description |
| ------------- |:---------------------------------------------| :---------------------------------------------|
| Id | INT(11) UNSIGNED NOT NULL AUTO_INCREMENT | Primary Key for a City |
| Name | VARCHAR(255) NOT NULL | City name |
| RegionId | INT(11) UNSIGNED NOT NULL | Foreign key to Regions table |