I Need Countries List in T-SQL

前端 未结 5 1578
不知归路
不知归路 2021-02-13 04:28

I have a Country table which has CountryName column. I need a ready made list in DDL to populate in the column CountryName.

The table resides in SQL Server 2008.

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-13 05:03

    CREATE TABLE `apps_countries` (
    `id` int(11) NOT NULL auto_increment,
    `country_code` varchar(2) NOT NULL default '',
    `country_name` varchar(100) NOT NULL default '',
    PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    -- 
    -- Dumping data for table `apps_countries`
    -- 
    INSERT INTO `apps_countries` VALUES (null, 'AF', 'Afghanistan');
    INSERT INTO `apps_countries` VALUES (null, 'AL', 'Albania');
    INSERT INTO `apps_countries` VALUES (null, 'DZ', 'Algeria');
    INSERT INTO `apps_countries` VALUES (null, 'DS', 'American Samoa');
    INSERT INTO `apps_countries` VALUES (null, 'AD', 'Andorra');
    INSERT INTO `apps_countries` VALUES (null, 'AO', 'Angola');
    INSERT INTO `apps_countries` VALUES (null, 'AI', 'Anguilla');
    INSERT INTO `apps_countries` VALUES (null, 'AQ', 'Antarctica');
    INSERT INTO `apps_countries` VALUES (null, 'AG', 'Antigua and Barbuda');
    INSERT INTO `apps_countries` VALUES (null, 'AR', 'Argentina');
    INSERT INTO `apps_countries` VALUES (null, 'AM', 'Armenia');
    INSERT INTO `apps_countries` VALUES (null, 'AW', 'Aruba');
    INSERT INTO `apps_countries` VALUES (null, 'AU', 'Australia');
    INSERT INTO `apps_countries` VALUES (null, 'AT', 'Austria');
    INSERT INTO `apps_countries` VALUES (null, 'AZ', 'Azerbaijan');
    INSERT INTO `apps_countries` VALUES (null, 'BS', 'Bahamas');
    INSERT INTO `apps_countries` VALUES (null, 'BH', 'Bahrain');
    INSERT INTO `apps_countries` VALUES (null, 'BD', 'Bangladesh');
    INSERT INTO `apps_countries` VALUES (null, 'BB', 'Barbados');
    INSERT INTO `apps_countries` VALUES (null, 'BY', 'Belarus');
    INSERT INTO `apps_countries` VALUES (null, 'BE', 'Belgium');
    INSERT INTO `apps_countries` VALUES (null, 'BZ', 'Belize');
    INSERT INTO `apps_countries` VALUES (null, 'BJ', 'Benin');
    INSERT INTO `apps_countries` VALUES (null, 'BM', 'Bermuda');
    INSERT INTO `apps_countries` VALUES (null, 'BT', 'Bhutan');
    INSERT INTO `apps_countries` VALUES (null, 'BO', 'Bolivia');
    INSERT INTO `apps_countries` VALUES (null, 'BA', 'Bosnia and Herzegovina');
    INSERT INTO `apps_countries` VALUES (null, 'BW', 'Botswana');
    INSERT INTO `apps_countries` VALUES (null, 'BV', 'Bouvet Island');
    INSERT INTO `apps_countries` VALUES (null, 'BR', 'Brazil');
    INSERT INTO `apps_countries` VALUES (null, 'IO', 'British Indian Ocean Territory');
    INSERT INTO `apps_countries` VALUES (null, 'BN', 'Brunei Darussalam');
    INSERT INTO `apps_countries` VALUES (null, 'BG', 'Bulgaria');
    INSERT INTO `apps_countries` VALUES (null, 'BF', 'Burkina Faso');
    INSERT INTO `apps_countries` VALUES (null, 'BI', 'Burundi');
    INSERT INTO `apps_countries` VALUES (null, 'KH', 'Cambodia');
    INSERT INTO `apps_countries` VALUES (null, 'CM', 'Cameroon');
    INSERT INTO `apps_countries` VALUES (null, 'CA', 'Canada');
    INSERT INTO `apps_countries` VALUES (null, 'CV', 'Cape Verde');
    INSERT INTO `apps_countries` VALUES (null, 'KY', 'Cayman Islands');
    INSERT INTO `apps_countries` VALUES (null, 'CF', 'Central African Republic');
    INSERT INTO `apps_countries` VALUES (null, 'TD', 'Chad');
    INSERT INTO `apps_countries` VALUES (null, 'CL', 'Chile');
    INSERT INTO `apps_countries` VALUES (null, 'CN', 'China');
    INSERT INTO `apps_countries` VALUES (null, 'CX', 'Christmas Island');
    INSERT INTO `apps_countries` VALUES (null, 'CC', 'Cocos (Keeling) Islands');
    INSERT INTO `apps_countries` VALUES (null, 'CO', 'Colombia');
    INSERT INTO `apps_countries` VALUES (null, 'KM', 'Comoros');
    INSERT INTO `apps_countries` VALUES (null, 'CD', 'Democratic Republic of the Congo');
    INSERT INTO `apps_countries` VALUES (null, 'CG', 'Republic of Congo');
    INSERT INTO `apps_countries` VALUES (null, 'CK', 'Cook Islands');
    INSERT INTO `apps_countries` VALUES (null, 'CR', 'Costa Rica');
    INSERT INTO `apps_countries` VALUES (null, 'HR', 'Croatia (Hrvatska)');
    INSERT INTO `apps_countries` VALUES (null, 'CU', 'Cuba');
    INSERT INTO `apps_countries` VALUES (null, 'CY', 'Cyprus');
    INSERT INTO `apps_countries` VALUES (null, 'CZ', 'Czech Republic');
    INSERT INTO `apps_countries` VALUES (null, 'DK', 'Denmark');
    INSERT INTO `apps_countries` VALUES (null, 'DJ', 'Djibouti');
    INSERT INTO `apps_countries` VALUES (null, 'DM', 'Dominica');
    INSERT INTO `apps_countries` VALUES (null, 'DO', 'Dominican Republic');
    INSERT INTO `apps_countries` VALUES (null, 'TP', 'East Timor');
    INSERT INTO `apps_countries` VALUES (null, 'EC', 'Ecuador');
    INSERT INTO `apps_countries` VALUES (null, 'EG', 'Egypt');
    INSERT INTO `apps_countries` VALUES (null, 'SV', 'El Salvador');
    INSERT INTO `apps_countries` VALUES (null, 'GQ', 'Equatorial Guinea');
    INSERT INTO `apps_countries` VALUES (null, 'ER', 'Eritrea');
    INSERT INTO `apps_countries` VALUES (null, 'EE', 'Estonia');
    INSERT INTO `apps_countries` VALUES (null, 'ET', 'Ethiopia');
    INSERT INTO `apps_countries` VALUES (null, 'FK', 'Falkland Islands (Malvinas)');
    INSERT INTO `apps_countries` VALUES (null, 'FO', 'Faroe Islands');
    INSERT INTO `apps_countries` VALUES (null, 'FJ', 'Fiji');
    INSERT INTO `apps_countries` VALUES (null, 'FI', 'Finland');
    INSERT INTO `apps_countries` VALUES (null, 'FR', 'France');
    INSERT INTO `apps_countries` VALUES (null, 'FX', 'France, Metropolitan');
    INSERT INTO `apps_countries` VALUES (null, 'GF', 'French Guiana');
    INSERT INTO `apps_countries` VALUES (null, 'PF', 'French Polynesia');
    INSERT INTO `apps_countries` VALUES (null, 'TF', 'French Southern Territories');
    INSERT INTO `apps_countries` VALUES (null, 'GA', 'Gabon');
    INSERT INTO `apps_countries` VALUES (null, 'GM', 'Gambia');
    INSERT INTO `apps_countries` VALUES (null, 'GE', 'Georgia');
    INSERT INTO `apps_countries` VALUES (null, 'DE', 'Germany');
    INSERT INTO `apps_countries` VALUES (null, 'GH', 'Ghana');
    INSERT INTO `apps_countries` VALUES (null, 'GI', 'Gibraltar');
    INSERT INTO `apps_countries` VALUES (null, 'GK', 'Guernsey');
    INSERT INTO `apps_countries` VALUES (null, 'GR', 'Greece');
    INSERT INTO `apps_countries` VALUES (null, 'GL', 'Greenland');
    INSERT INTO `apps_countries` VALUES (null, 'GD', 'Grenada');
    INSERT INTO `apps_countries` VALUES (null, 'GP', 'Guadeloupe');
    INSERT INTO `apps_countries` VALUES (null, 'GU', 'Guam');
    INSERT INTO `apps_countries` VALUES (null, 'GT', 'Guatemala');
    INSERT INTO `apps_countries` VALUES (null, 'GN', 'Guinea');
    INSERT INTO `apps_countries` VALUES (null, 'GW', 'Guinea-Bissau');
    INSERT INTO `apps_countries` VALUES (null, 'GY', 'Guyana');
    INSERT INTO `apps_countries` VALUES (null, 'HT', 'Haiti');
    INSERT INTO `apps_countries` VALUES (null, 'HM', 'Heard and Mc Donald Islands');
    INSERT INTO `apps_countries` VALUES (null, 'HN', 'Honduras');
    INSERT INTO `apps_countries` VALUES (null, 'HK', 'Hong Kong');
    INSERT INTO `apps_countries` VALUES (null, 'HU', 'Hungary');
    INSERT INTO `apps_countries` VALUES (null, 'IS', 'Iceland');
    INSERT INTO `apps_countries` VALUES (null, 'IN', 'India');
    INSERT INTO `apps_countries` VALUES (null, 'IM', 'Isle of Man');
    INSERT INTO `apps_countries` VALUES (null, 'ID', 'Indonesia');
    INSERT INTO `apps_countries` VALUES (null, 'IR', 'Iran (Islamic Republic of)');
    INSERT INTO `apps_countries` VALUES (null, 'IQ', 'Iraq');
    INSERT INTO `apps_countries` VALUES (null, 'IE', 'Ireland');
    INSERT INTO `apps_countries` VALUES (null, 'IL', 'Israel');
    INSERT INTO `apps_countries` VALUES (null, 'IT', 'Italy');
    INSERT INTO `apps_countries` VALUES (null, 'CI', 'Ivory Coast');
    INSERT INTO `apps_countries` VALUES (null, 'JE', 'Jersey');
    INSERT INTO `apps_countries` VALUES (null, 'JM', 'Jamaica');
    INSERT INTO `apps_countries` VALUES (null, 'JP', 'Japan');
    INSERT INTO `apps_countries` VALUES (null, 'JO', 'Jordan');
    INSERT INTO `apps_countries` VALUES (null, 'KZ', 'Kazakhstan');
    INSERT INTO `apps_countries` VALUES (null, 'KE', 'Kenya');
    INSERT INTO `apps_countries` VALUES (null, 'KI', 'Kiribati');
    INSERT INTO `apps_countries` VALUES (null, 'KP', 'Korea, Democratic People''s Republic of');
    INSERT INTO `apps_countries` VALUES (null, 'KR', 'Korea, Republic of');
    INSERT INTO `apps_countries` VALUES (null, 'XK', 'Kosovo');
    INSERT INTO `apps_countries` VALUES (null, 'KW', 'Kuwait');
    INSERT INTO `apps_countries` VALUES (null, 'KG', 'Kyrgyzstan');
    INSERT INTO `apps_countries` VALUES (null, 'LA', 'Lao People''s Democratic Republic');
    INSERT INTO `apps_countries` VALUES (null, 'LV', 'Latvia');
    INSERT INTO `apps_countries` VALUES (null, 'LB', 'Lebanon');
    INSERT INTO `apps_countries` VALUES (null, 'LS', 'Lesotho');
    INSERT INTO `apps_countries` VALUES (null, 'LR', 'Liberia');
    INSERT INTO `apps_countries` VALUES (null, 'LY', 'Libyan Arab Jamahiriya');
    INSERT INTO `apps_countries` VALUES (null, 'LI', 'Liechtenstein');
    INSERT INTO `apps_countries` VALUES (null, 'LT', 'Lithuania');
    INSERT INTO `apps_countries` VALUES (null, 'LU', 'Luxembourg');
    INSERT INTO `apps_countries` VALUES (null, 'MO', 'Macau');
    INSERT INTO `apps_countries` VALUES (null, 'MK', 'North Macedonia');
    INSERT INTO `apps_countries` VALUES (null, 'MG', 'Madagascar');
    INSERT INTO `apps_countries` VALUES (null, 'MW', 'Malawi');
    INSERT INTO `apps_countries` VALUES (null, 'MY', 'Malaysia');
    INSERT INTO `apps_countries` VALUES (null, 'MV', 'Maldives');
    INSERT INTO `apps_countries` VALUES (null, 'ML', 'Mali');
    INSERT INTO `apps_countries` VALUES (null, 'MT', 'Malta');
    INSERT INTO `apps_countries` VALUES (null, 'MH', 'Marshall Islands');
    INSERT INTO `apps_countries` VALUES (null, 'MQ', 'Martinique');
    INSERT INTO `apps_countries` VALUES (null, 'MR', 'Mauritania');
    INSERT INTO `apps_countries` VALUES (null, 'MU', 'Mauritius');
    INSERT INTO `apps_countries` VALUES (null, 'TY', 'Mayotte');
    INSERT INTO `apps_countries` VALUES (null, 'MX', 'Mexico');
    INSERT INTO `apps_countries` VALUES (null, 'FM', 'Micronesia, Federated States of');
    INSERT INTO `apps_countries` VALUES (null, 'MD', 'Moldova, Republic of');
    INSERT INTO `apps_countries` VALUES (null, 'MC', 'Monaco');
    INSERT INTO `apps_countries` VALUES (null, 'MN', 'Mongolia');
    INSERT INTO `apps_countries` VALUES (null, 'ME', 'Montenegro');
    INSERT INTO `apps_countries` VALUES (null, 'MS', 'Montserrat');
    INSERT INTO `apps_countries` VALUES (null, 'MA', 'Morocco');
    INSERT INTO `apps_countries` VALUES (null, 'MZ', 'Mozambique');
    INSERT INTO `apps_countries` VALUES (null, 'MM', 'Myanmar');
    INSERT INTO `apps_countries` VALUES (null, 'NA', 'Namibia');
    INSERT INTO `apps_countries` VALUES (null, 'NR', 'Nauru');
    INSERT INTO `apps_countries` VALUES (null, 'NP', 'Nepal');
    INSERT INTO `apps_countries` VALUES (null, 'NL', 'Netherlands');
    INSERT INTO `apps_countries` VALUES (null, 'AN', 'Netherlands Antilles');
    INSERT INTO `apps_countries` VALUES (null, 'NC', 'New Caledonia');
    INSERT INTO `apps_countries` VALUES (null, 'NZ', 'New Zealand');
    INSERT INTO `apps_countries` VALUES (null, 'NI', 'Nicaragua');
    INSERT INTO `apps_countries` VALUES (null, 'NE', 'Niger');
    INSERT INTO `apps_countries` VALUES (null, 'NG', 'Nigeria');
    INSERT INTO `apps_countries` VALUES (null, 'NU', 'Niue');
    INSERT INTO `apps_countries` VALUES (null, 'NF', 'Norfolk Island');
    INSERT INTO `apps_countries` VALUES (null, 'MP', 'Northern Mariana Islands');
    INSERT INTO `apps_countries` VALUES (null, 'NO', 'Norway');
    INSERT INTO `apps_countries` VALUES (null, 'OM', 'Oman');
    INSERT INTO `apps_countries` VALUES (null, 'PK', 'Pakistan');
    INSERT INTO `apps_countries` VALUES (null, 'PW', 'Palau');
    INSERT INTO `apps_countries` VALUES (null, 'PS', 'Palestine');
    INSERT INTO `apps_countries` VALUES (null, 'PA', 'Panama');
    INSERT INTO `apps_countries` VALUES (null, 'PG', 'Papua New Guinea');
    INSERT INTO `apps_countries` VALUES (null, 'PY', 'Paraguay');
    INSERT INTO `apps_countries` VALUES (null, 'PE', 'Peru');
    INSERT INTO `apps_countries` VALUES (null, 'PH', 'Philippines');
    INSERT INTO `apps_countries` VALUES (null, 'PN', 'Pitcairn');
    INSERT INTO `apps_countries` VALUES (null, 'PL', 'Poland');
    INSERT INTO `apps_countries` VALUES (null, 'PT', 'Portugal');
    INSERT INTO `apps_countries` VALUES (null, 'PR', 'Puerto Rico');
    INSERT INTO `apps_countries` VALUES (null, 'QA', 'Qatar');
    INSERT INTO `apps_countries` VALUES (null, 'RE', 'Reunion');
    INSERT INTO `apps_countries` VALUES (null, 'RO', 'Romania');
    INSERT INTO `apps_countries` VALUES (null, 'RU', 'Russian Federation');
    INSERT INTO `apps_countries` VALUES (null, 'RW', 'Rwanda');
    INSERT INTO `apps_countries` VALUES (null, 'KN', 'Saint Kitts and Nevis');
    INSERT INTO `apps_countries` VALUES (null, 'LC', 'Saint Lucia');
    INSERT INTO `apps_countries` VALUES (null, 'VC', 'Saint Vincent and the Grenadines');
    INSERT INTO `apps_countries` VALUES (null, 'WS', 'Samoa');
    INSERT INTO `apps_countries` VALUES (null, 'SM', 'San Marino');
    INSERT INTO `apps_countries` VALUES (null, 'ST', 'Sao Tome and Principe');
    INSERT INTO `apps_countries` VALUES (null, 'SA', 'Saudi Arabia');
    INSERT INTO `apps_countries` VALUES (null, 'SN', 'Senegal');
    INSERT INTO `apps_countries` VALUES (null, 'RS', 'Serbia');
    INSERT INTO `apps_countries` VALUES (null, 'SC', 'Seychelles');
    INSERT INTO `apps_countries` VALUES (null, 'SL', 'Sierra Leone');
    INSERT INTO `apps_countries` VALUES (null, 'SG', 'Singapore');
    INSERT INTO `apps_countries` VALUES (null, 'SK', 'Slovakia');
    INSERT INTO `apps_countries` VALUES (null, 'SI', 'Slovenia');
    INSERT INTO `apps_countries` VALUES (null, 'SB', 'Solomon Islands');
    INSERT INTO `apps_countries` VALUES (null, 'SO', 'Somalia');
    INSERT INTO `apps_countries` VALUES (null, 'ZA', 'South Africa');
    INSERT INTO `apps_countries` VALUES (null, 'GS', 'South Georgia South Sandwich Islands');
    INSERT INTO `apps_countries` VALUES (null, 'SS', 'South Sudan');
    INSERT INTO `apps_countries` VALUES (null, 'ES', 'Spain');
    INSERT INTO `apps_countries` VALUES (null, 'LK', 'Sri Lanka');
    INSERT INTO `apps_countries` VALUES (null, 'SH', 'St. Helena');
    INSERT INTO `apps_countries` VALUES (null, 'PM', 'St. Pierre and Miquelon');
    INSERT INTO `apps_countries` VALUES (null, 'SD', 'Sudan');
    INSERT INTO `apps_countries` VALUES (null, 'SR', 'Suriname');
    INSERT INTO `apps_countries` VALUES (null, 'SJ', 'Svalbard and Jan Mayen Islands');
    INSERT INTO `apps_countries` VALUES (null, 'SZ', 'Swaziland');
    INSERT INTO `apps_countries` VALUES (null, 'SE', 'Sweden');
    INSERT INTO `apps_countries` VALUES (null, 'CH', 'Switzerland');
    INSERT INTO `apps_countries` VALUES (null, 'SY', 'Syrian Arab Republic');
    INSERT INTO `apps_countries` VALUES (null, 'TW', 'Taiwan');
    INSERT INTO `apps_countries` VALUES (null, 'TJ', 'Tajikistan');
    INSERT INTO `apps_countries` VALUES (null, 'TZ', 'Tanzania, United Republic of');
    INSERT INTO `apps_countries` VALUES (null, 'TH', 'Thailand');
    INSERT INTO `apps_countries` VALUES (null, 'TG', 'Togo');
    INSERT INTO `apps_countries` VALUES (null, 'TK', 'Tokelau');
    INSERT INTO `apps_countries` VALUES (null, 'TO', 'Tonga');
    INSERT INTO `apps_countries` VALUES (null, 'TT', 'Trinidad and Tobago');
    INSERT INTO `apps_countries` VALUES (null, 'TN', 'Tunisia');
    INSERT INTO `apps_countries` VALUES (null, 'TR', 'Turkey');
    INSERT INTO `apps_countries` VALUES (null, 'TM', 'Turkmenistan');
    INSERT INTO `apps_countries` VALUES (null, 'TC', 'Turks and Caicos Islands');
    INSERT INTO `apps_countries` VALUES (null, 'TV', 'Tuvalu');
    INSERT INTO `apps_countries` VALUES (null, 'UG', 'Uganda');
    INSERT INTO `apps_countries` VALUES (null, 'UA', 'Ukraine');
    INSERT INTO `apps_countries` VALUES (null, 'AE', 'United Arab Emirates');
    INSERT INTO `apps_countries` VALUES (null, 'GB', 'United Kingdom');
    INSERT INTO `apps_countries` VALUES (null, 'US', 'United States');
    INSERT INTO `apps_countries` VALUES (null, 'UM', 'United States minor outlying islands');
    INSERT INTO `apps_countries` VALUES (null, 'UY', 'Uruguay');
    INSERT INTO `apps_countries` VALUES (null, 'UZ', 'Uzbekistan');
    INSERT INTO `apps_countries` VALUES (null, 'VU', 'Vanuatu');
    INSERT INTO `apps_countries` VALUES (null, 'VA', 'Vatican City State');
    INSERT INTO `apps_countries` VALUES (null, 'VE', 'Venezuela');
    INSERT INTO `apps_countries` VALUES (null, 'VN', 'Vietnam');
    INSERT INTO `apps_countries` VALUES (null, 'VG', 'Virgin Islands (British)');
    INSERT INTO `apps_countries` VALUES (null, 'VI', 'Virgin Islands (U.S.)');
    INSERT INTO `apps_countries` VALUES (null, 'WF', 'Wallis and Futuna Islands');
    INSERT INTO `apps_countries` VALUES (null, 'EH', 'Western Sahara');
    INSERT INTO `apps_countries` VALUES (null, 'YE', 'Yemen');
    INSERT INTO `apps_countries` VALUES (null, 'ZM', 'Zambia');
    INSERT INTO `apps_countries` VALUES (null, 'ZW', 'Zimbabwe');
    

提交回复
热议问题