Sunday, April 29, 2012

Useful SQL Script to generate Countries



CREATE TABLE [Countries] (
[Id] [int] IDENTITY(1,1) NOT NULL,
[CountryCode] varchar(2) NOT NULL default '',
[CountryName] varchar(100) NOT NULL default '',
PRIMARY KEY ([Id])
)

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

SELECT * FROM Countries