- SQL Server insert statements
- Oracle insert statements
>>> original article below - links replaced with the new lookup link
The script which you can download from the link below creates a "countries" table and populates it with the complete ISO list including the Numerical Code of the country, the name of the country both in lower case letters and upper case letters, the ISO ALPHA-3 code and the ISO 3166-1-alpha-2 code.
A couple of notes:
- the Countries table created by the script does not have a Primary Key defined on it - you will need to define one.
- The following territories are listed on the ISO site but they are not listed on the UN site so I did not include them in the script.
UNITED STATES MINOR OUTLYING ISLANDS, UM
TAIWAN, PROVINCE OF CHINA, TW
HEARD ISLAND AND MCDONALD ISLANDS, HM
SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS, GS
VIRGIN ISLANDS, BRITISH, VG
FRENCH SOUTHERN TERRITORIES, TF
CHRISTMAS ISLAND, CX
COCOS (KEELING) ISLANDS, CC
BOUVET ISLAND, BV
You can download the script from here: https://lookups.xsql.com/