skip to Main Content

Here is my code:

SELECT * 
FROM OPENJSON ('{"AFN":{"code":"AFN","name":"Afghan Afghani","decimal_digits":0,"name_plural":"Afghan Afghanis","rounding":0,"symbol":"Af","symbol_native":"؋"},"ALL":{"code":"ALL","name":"Albanian Lek","decimal_digits":0,"name_plural":"Albanian lekë","rounding":0,"symbol":"ALL","symbol_native":"Lek"},"AMD":{"code":"AMD","name":"Armenian Dram","decimal_digits":0,"name_plural":"Armenian drams","rounding":0,"symbol":"AMD","symbol_native":"դր."},"ANG":{"code":"ANG","name":"NL Antillean Guilder","decimal_digits":2,"name_plural":"NL Antillean Guilders","rounding":0,"symbol":"ƒ","symbol_native":"NAƒ"},"AOA":{"code":"AOA","name":"Angolan Kwanza","decimal_digits":2,"name_plural":"Angolan Kwanza","rounding":0,"symbol":"Kz","symbol_native":"Kz"},"ARS":{"code":"ARS","name":"Argentine Peso","decimal_digits":2,"name_plural":"Argentine pesos","rounding":0,"symbol":"AR$","symbol_native":"$"},"AUD":{"code":"AUD","name":"Australian Dollar","decimal_digits":2,"name_plural":"Australian dollars","rounding":0,"symbol":"AU$","symbol_native":"$"},"AWG":{"code":"AWG","name":"Aruban Florin","decimal_digits":2,"name_plural":"Aruban Florin","rounding":0,"symbol":"Afl.","symbol_native":"Afl."},"AZN":{"code":"AZN","name":"Azerbaijani Manat","decimal_digits":2,"name_plural":"Azerbaijani manats","rounding":0,"symbol":"man.","symbol_native":"ман."},"BAM":{"code":"BAM","name":"Bosnia-Herzegovina Convertible Mark","decimal_digits":2,"name_plural":"Bosnia-Herzegovina convertible marks","rounding":0,"symbol":"KM","symbol_native":"KM"},"BBD":{"code":"BBD","name":"Barbadian Dollar","decimal_digits":2,"name_plural":"Barbadian Dollars","rounding":0,"symbol":"Bds$","symbol_native":"$"},"BDT":{"code":"BDT","name":"Bangladeshi Taka","decimal_digits":2,"name_plural":"Bangladeshi takas","rounding":0,"symbol":"Tk","symbol_native":"৳"},"BGN":{"code":"BGN","name":"Bulgarian Lev","decimal_digits":2,"name_plural":"Bulgarian leva","rounding":0,"symbol":"BGN","symbol_native":"лв."},"BHD":{"code":"BHD","name":"Bahraini Dinar","decimal_digits":3,"name_plural":"Bahraini dinars","rounding":0,"symbol":"BD","symbol_native":"د.ب.‏"},"BIF":{"code":"BIF","name":"Burundian Franc","decimal_digits":0,"name_plural":"Burundian francs","rounding":0,"symbol":"FBu","symbol_native":"FBu"},"BMD":{"code":"BMD","name":"Bermudan Dollar","decimal_digits":2,"name_plural":"Bermudan Dollars","rounding":0,"symbol":"BD$","symbol_native":"$"},"BND":{"code":"BND","name":"Brunei Dollar","decimal_digits":2,"name_plural":"Brunei dollars","rounding":0,"symbol":"BN$","symbol_native":"$"},"BOB":{"code":"BOB","name":"Bolivian Boliviano","decimal_digits":2,"name_plural":"Bolivian bolivianos","rounding":0,"symbol":"Bs","symbol_native":"Bs"},"BRL":{"code":"BRL","name":"Brazilian Real","decimal_digits":2,"name_plural":"Brazilian reals","rounding":0,"symbol":"R$","symbol_native":"R$"},"BSD":{"code":"BSD","name":"Bahamian Dollar","decimal_digits":2,"name_plural":"Bahamian Dollars","rounding":0,"symbol":"B$","symbol_native":"$"},"BWP":{"code":"BWP","name":"Botswanan Pula","decimal_digits":2,"name_plural":"Botswanan pulas","rounding":0,"symbol":"BWP","symbol_native":"P"},"BYN":{"code":"BYN","name":"Belarusian ruble","decimal_digits":2,"name_plural":"Belarusian rubles","rounding":0,"symbol":"Br","symbol_native":"Br"},"BYR":{"code":"BYR","name":"Belarusian Ruble","decimal_digits":0,"name_plural":"Belarusian rubles","rounding":0,"symbol":"BYR","symbol_native":"BYR"},"BZD":{"code":"BZD","name":"Belize Dollar","decimal_digits":2,"name_plural":"Belize dollars","rounding":0,"symbol":"BZ$","symbol_native":"$"},"CAD":{"code":"CAD","name":"Canadian Dollar","decimal_digits":2,"name_plural":"Canadian dollars","rounding":0,"symbol":"CA$","symbol_native":"$"},"CDF":{"code":"CDF","name":"Congolese Franc","decimal_digits":2,"name_plural":"Congolese francs","rounding":0,"symbol":"CDF","symbol_native":"FrCD"},"CHF":{"code":"CHF","name":"Swiss Franc","decimal_digits":2,"name_plural":"Swiss francs","rounding":0,"symbol":"CHF","symbol_native":"CHF"},"CLF":{"code":"CLF","name":"Unidad de Fomento","decimal_digits":2,"name_plural":"Unidad de Fomentos","rounding":0,"symbol":"UF","symbol_native":"UF"},"CLP":{"code":"CLP","name":"Chilean Peso","decimal_digits":0,"name_plural":"Chilean pesos","rounding":0,"symbol":"CL$","symbol_native":"$"},"CNY":{"code":"CNY","name":"Chinese Yuan","decimal_digits":2,"name_plural":"Chinese yuan","rounding":0,"symbol":"CN¥","symbol_native":"CN¥"},"COP":{"code":"COP","name":"Coombian Peso","decimal_digits":0,"name_plural":"Colombian pesos","rounding":0,"symbol":"CO$","symbol_native":"$"},"CRC":{"code":"CRC","name":"Costa Rican Colón","decimal_digits":0,"name_plural":"Costa Rican colóns","rounding":0,"symbol":"₡","symbol_native":"₡"},"CUC":{"code":"CUC","name":"Cuban Convertible Peso","decimal_digits":2,"name_plural":"Cuban Convertible Peso","rounding":0,"symbol":"CUC$","symbol_native":"$"},"CUP":{"code":"CUP","name":"Cuban Peso","decimal_digits":2,"name_plural":"Cuban Peso","rounding":0,"symbol":"$MN","symbol_native":"$"},"CVE":{"code":"CVE","name":"Cape Verdean Escudo","decimal_digits":2,"name_plural":"Cape Verdean escudos","rounding":0,"symbol":"CV$","symbol_native":"CV$"},"CZK":{"code":"CZK","name":"Czech Republic Koruna","decimal_digits":2,"name_plural":"Czech Republic korunas","rounding":0,"symbol":"Kč","symbol_native":"Kč"},"DJF":{"code":"DJF","name":"Djiboutian Franc","decimal_digits":0,"name_plural":"Djiboutian francs","rounding":0,"symbol":"Fdj","symbol_native":"Fdj"},"DKK":{"code":"DKK","name":"Danish Krone","decimal_digits":2,"name_plural":"Danish kroner","rounding":0,"symbol":"Dkr","symbol_native":"kr"},"DOP":{"code":"DOP","name":"Dominican Peso","decimal_digits":2,"name_plural":"Dominican pesos","rounding":0,"symbol":"RD$","symbol_native":"RD$"},"DZD":{"code":"DZD","name":"Algerian Dinar","decimal_digits":2,"name_plural":"Algerian dinars","rounding":0,"symbol":"DA","symbol_native":"د.ج.‏"},"ERN":{"code":"ERN","name":"Eritrean Nakfa","decimal_digits":2,"name_plural":"Eritrean nakfas","rounding":0,"symbol":"Nfk","symbol_native":"Nfk"},"ETB":{"code":"ETB","name":"Ethiopian Birr","decimal_digits":2,"name_plural":"Ethiopian birrs","rounding":0,"symbol":"Br","symbol_native":"Br"},"EUR":{"code":"EUR","name":"Euro","decimal_digits":2,"name_plural":"Euros","rounding":0,"symbol":"€","symbol_native":"€"},"FJD":{"code":"FJD","name":"Fijian Dollar","decimal_digits":2,"name_plural":"Fijian Dollar","rounding":0,"symbol":"FJ$","symbol_native":"$"},"FKP":{"code":"FKP","name":"Falkland Islands Pound","decimal_digits":2,"name_plural":"Falkland Islands Pound","rounding":0,"symbol":"FK£","symbol_native":"£"},"GBP":{"code":"GBP","name":"British Pound Sterling","decimal_digits":2,"name_plural":"British pounds sterling","rounding":0,"symbol":"£","symbol_native":"£"},"GEL":{"code":"GEL","name":"Georgian Lari","decimal_digits":2,"name_plural":"Georgian laris","rounding":0,"symbol":"GEL","symbol_native":"GEL"},"GGP":{"code":"GGP","name":"Guernsey pound","decimal_digits":2,"name_plural":"Guernsey pounds","rounding":0,"symbol":"£","symbol_native":"£"},"GHS":{"code":"GHS","name":"Ghanaian Cedi","decimal_digits":2,"name_plural":"Ghanaian cedis","rounding":0,"symbol":"GH₵","symbol_native":"GH₵"},"GIP":{"code":"GIP","name":"Gibraltar Pound","decimal_digits":2,"name_plural":"Gibraltar Pounds","rounding":0,"symbol":"£","symbol_native":"£"},"GMD":{"code":"GMD","name":"Gambian Dalasi","decimal_digits":2,"name_plural":"Gambian Dalasi","rounding":0,"symbol":"D","symbol_native":"D"},"GNF":{"code":"GNF","name":"Guinean Franc","decimal_digits":0,"name_plural":"Guinean francs","rounding":0,"symbol":"FG","symbol_native":"FG"},"GTQ":{"code":"GTQ","name":"Guatemalan Quetzal","decimal_digits":2,"name_plural":"Guatemalan quetzals","rounding":0,"symbol":"GTQ","symbol_native":"Q"},"GYD":{"code":"GYD","name":"Guyanaese Dollar","decimal_digits":2,"name_plural":"Guyanaese Dollar","rounding":0,"symbol":"G$","symbol_native":"$"},"HKD":{"code":"HKD","name":"Hong Kong Dollar","decimal_digits":2,"name_plural":"Hong Kong dollars","rounding":0,"symbol":"HK$","symbol_native":"$"},"HNL":{"code":"HNL","name":"Honduran Lempira","decimal_digits":2,"name_plural":"Honduran lempiras","rounding":0,"symbol":"HNL","symbol_native":"L"},"HRK":{"code":"HRK","name":"Croatian Kuna","decimal_digits":2,"name_plural":"Croatian kunas","rounding":0,"symbol":"kn","symbol_native":"kn"},"HTG":{"code":"HTG","name":"Haitian Gourde","decimal_digits":2,"name_plural":"Haitian Gourde","rounding":0,"symbol":"G","symbol_native":"G"},"HUF":{"code":"HUF","name":"Hungarian Forint","decimal_digits":0,"name_plural":"Hungarian forints","rounding":0,"symbol":"Ft","symbol_native":"Ft"},"IDR":{"code":"IDR","name":"Indonesian Rupiah","decimal_digits":0,"name_plural":"Indonesian rupiahs","rounding":0,"symbol":"Rp","symbol_native":"Rp"},"ILS":{"code":"ILS","name":"Israeli New Sheqel","decimal_digits":2,"name_plural":"Israeli new sheqels","rounding":0,"symbol":"₪","symbol_native":"₪"},"IMP":{"code":"IMP","name":"Manx pound","decimal_digits":2,"name_plural":"Manx pounds","rounding":0,"symbol":"£","symbol_native":"£"},"IQD":{"code":"IQD","name":"Iraqi Dinar","decimal_digits":0,"name_plural":"Iraqi dinars","rounding":0,"symbol":"IQD","symbol_native":"د.ع.‏"},"IRR":{"code":"IRR","name":"Iranian Rial","decimal_digits":0,"name_plural":"Iranian rials","rounding":0,"symbol":"IRR","symbol_native":"﷼"},"ISK":{"code":"ISK","name":"Icelandic Króna","decimal_digits":0,"name_plural":"Icelandic krónur","rounding":0,"symbol":"Ikr","symbol_native":"kr"},"JEP":{"code":"JEP","name":"Jersey pound","decimal_digits":2,"name_plural":"Jersey pound","rounding":0,"symbol":"£","symbol_native":"£"},"JMD":{"code":"JMD","name":"Jamaican Dollar","decimal_digits":2,"name_plural":"Jamaican dollars","rounding":0,"symbol":"J$","symbol_native":"$"},"JOD":{"code":"JOD","name":"Jordanian Dinar","decimal_digits":3,"name_plural":"Jordanian dinars","rounding":0,"symbol":"JD","symbol_native":"د.أ.‏"},"JPY":{"code":"JPY","name":"Japanese Yen","decimal_digits":0,"name_plural":"Japanese yen","rounding":0,"symbol":"¥","symbol_native":"¥"},"KES":{"code":"KES","name":"Kenyan Shilling","decimal_digits":2,"name_plural":"Kenyan shillings","rounding":0,"symbol":"Ksh","symbol_native":"Ksh"},"KGS":{"code":"KGS","name":"Kyrgystani Som","decimal_digits":2,"name_plural":"Kyrgystani Som","rounding":0,"symbol":"KGS","symbol_native":"KGS"},"KHR":{"code":"KHR","name":"Cambodian Riel","decimal_digits":2,"name_plural":"Cambodian riels","rounding":0,"symbol":"KHR","symbol_native":"៛"},"KMF":{"code":"KMF","name":"Comorian Franc","decimal_digits":0,"name_plural":"Comorian francs","rounding":0,"symbol":"CF","symbol_native":"FC"},"KPW":{"code":"KPW","name":"North Korean Won","decimal_digits":2,"name_plural":"North Korean Won","rounding":0,"symbol":"₩","symbol_native":"₩"},"KRW":{"code":"KRW","name":"South Korean Won","decimal_digits":0,"name_plural":"South Korean won","rounding":0,"symbol":"₩","symbol_native":"₩"},"KWD":{"code":"KWD","name":"Kuwaiti Dinar","decimal_digits":3,"name_plural":"Kuwaiti dinars","rounding":0,"symbol":"KD","symbol_native":"د.ك.‏"},"KYD":{"code":"KYD","name":"Cayman Islands Dollar","decimal_digits":2,"name_plural":"Cayman Islands Dollar","rounding":0,"symbol":"CI$","symbol_native":"$‏"},"KZT":{"code":"KZT","name":"Kazakhstani Tenge","decimal_digits":2,"name_plural":"Kazakhstani tenges","rounding":0,"symbol":"KZT","symbol_native":"тңг."},"LAK":{"code":"LAK","name":"Laotian Kip","decimal_digits":0,"name_plural":"Laotian Kip","rounding":0,"symbol":"₭N","symbol_native":"₭‏‏"},"LBP":{"code":"LBP","name":"Lebanese Pound","decimal_digits":0,"name_plural":"Lebanese pounds","rounding":0,"symbol":"LB£","symbol_native":"ل.ل.‏"},"LKR":{"code":"LKR","name":"Sri Lankan Rupee","decimal_digits":2,"name_plural":"Sri Lankan rupees","rounding":0,"symbol":"SLRs","symbol_native":"SL Re"},"LRD":{"code":"LRD","name":"Liberian Dollar","decimal_digits":2,"name_plural":"Liberian Dollar","rounding":0,"symbol":"LD$","symbol_native":"L$"},"LSL":{"code":"LSL","name":"Lesotho Loti","decimal_digits":2,"name_plural":"Lesotho Loti","rounding":0,"symbol":"L","symbol_native":"M"},"LTL":{"code":"LTL","name":"Lithuanian Litas","decimal_digits":2,"name_plural":"Lithuanian litai","rounding":0,"symbol":"Lt","symbol_native":"Lt"},"LVL":{"code":"LVL","name":"Latvian Lats","decimal_digits":2,"name_plural":"Latvian lati","rounding":0,"symbol":"Ls","symbol_native":"Ls"},"MAD":{"code":"MAD","name":"Moroccan Dirham","decimal_digits":2,"name_plural":"Moroccan dirhams","rounding":0,"symbol":"MAD","symbol_native":"د.م.‏"},"MDL":{"code":"MDL","name":"Moldovan Leu","decimal_digits":2,"name_plural":"Moldovan lei","rounding":0,"symbol":"MDL","symbol_native":"MDL"},"XAG":{"code":"XAG","name":"Silver Ounce","decimal_digits":2,"name_plural":"Silver Ounces","rounding":0,"symbol":"XAG","symbol_native":"XAG"},"XAU":{"code":"XAU","name":"Gold Ounce","decimal_digits":2,"name_plural":"Gold Ounces","rounding":0,"symbol":"XAU","symbol_native":"XAU"},"XCD":{"code":"XCD","name":"East Caribbean Dollar","decimal_digits":2,"name_plural":"East Caribbean Dollars","rounding":0,"symbol":"EC$","symbol_native":"$"},"XDR":{"code":"XDR","name":"Special drawing rights","decimal_digits":2,"name_plural":"Special drawing rights","rounding":0,"symbol":"SDR","symbol_native":"SDR"},"XOF":{"code":"XOF","name":"CFA Franc BCEAO","decimal_digits":0,"name_plural":"CFA francs BCEAO","rounding":0,"symbol":"CFA","symbol_native":"CFA"},"XPF":{"code":"XPF","name":"CFP Franc","decimal_digits":0,"name_plural":"CFP francs","rounding":0,"symbol":"CFP","symbol_native":"CFP"},"YER":{"code":"YER","name":"Yemeni Rial","decimal_digits":0,"name_plural":"Yemeni rials","rounding":0,"symbol":"YR","symbol_native":"ر.ي.‏"},"ZAR":{"code":"ZAR","name":"South African Rand","decimal_digits":2,"name_plural":"South African rand","rounding":0,"symbol":"R","symbol_native":"R"},"ZMK":{"code":"ZMK","name":"Zambian Kwacha","decimal_digits":0,"name_plural":"Zambian kwachas","rounding":0,"symbol":"ZK","symbol_native":"ZK"},"ZMW":{"code":"ZMW","name":"Zambian Kwacha","decimal_digits":0,"name_plural":"Zambian kwachas","rounding":0,"symbol":"ZK","symbol_native":"ZK"},"ZWL":{"code":"ZWL","name":"Zimbabwean dollar","decimal_digits":2,"name_plural":"Zimbabwean dollars","rounding":0,"symbol":"ZWL","symbol_native":"$"},"XPT":{"code":"XPT","name":"Platinum Ounce","decimal_digits":6,"name_plural":"Platinum Ounces","rounding":0,"symbol":"XPT","symbol_native":"XPT"},"XPD":{"code":"XPD","name":"Palladium Ounce","decimal_digits":6,"name_plural":"Palladium Ounces","rounding":0,"symbol":"XPD","symbol_native":"XPD"},"BTC":{"code":"BTC","name":"Bitcoin","decimal_digits":8,"name_plural":"Bitcoins","rounding":0,"symbol":"₿","symbol_native":"₿"},"ETH":{"code":"ETH","name":"Ethereum","decimal_digits":18,"name_plural":"Ethereum","rounding":0,"symbol":"Ξ","symbol_native":"Ξ"},"BNB":{"code":"BNB","name":"Binance","decimal_digits":8,"name_plural":"Binance","rounding":0,"symbol":"BNB","symbol_native":"BNB"},"XRP":{"code":"XRP","name":"Ripple","decimal_digits":6,"name_plural":"Ripple","rounding":0,"symbol":"XRP","symbol_native":"XRP"},"SOL":{"code":"SOL","name":"Solana","decimal_digits":9,"name_plural":"Solana","rounding":0,"symbol":"SOL","symbol_native":"SOL"},"DOT":{"code":"DOT","name":"Polkadot","decimal_digits":10,"name_plural":"Polkadot","rounding":0,"symbol":"DOT","symbol_native":"DOT"},"AVAX":{"code":"AVAX","name":"Avalanche","decimal_digits":18,"name_plural":"Avalanche","rounding":0,"symbol":"AVAX","symbol_native":"AVAX"},"MATIC":{"code":"MATIC","name":"Matic Token","decimal_digits":18,"name_plural":"Matic Tokens","rounding":0,"symbol":"MATIC","symbol_native":"MATIC"},"LTC":{"code":"LTC","name":"Litecoin","decimal_digits":8,"name_plural":"Litecoins","rounding":0,"symbol":"Ł","symbol_native":"Ł"},"ADA":{"code":"ADA","name":"Cardano","decimal_digits":6,"name_plural":"Cardanos","rounding":0,"symbol":"ADA","symbol_native":"ADA"},"USDT":{"code":"USDT","name":"Tether","decimal_digits":2,"name_plural":"Tethers","rounding":0,"symbol":"USDT","symbol_native":"USDT"},"USDC":{"code":"USDC","name":"USD Coin","decimal_digits":2,"name_plural":"USD Coins","rounding":0,"symbol":"USDC","symbol_native":"USDC"},"DAI":{"code":"DAI","name":"Dai","decimal_digits":2,"name_plural":"Dais","rounding":0,"symbol":"DAI","symbol_native":"DAI"},"BUSD":{"code":"BUSD","name":"Binance USD","decimal_digits":8,"name_plural":"Binance USD","rounding":0,"symbol":"BUSD","symbol_native":"BUSD"},"ARB":{"code":"ARB","name":"Arbitrum","decimal_digits":8,"name_plural":"Arbitrums","rounding":0,"symbol":"ARB","symbol_native":"ARB"},"OP":{"code":"OP","name":"Optimism","decimal_digits":8,"name_plural":"Optimism","rounding":0,"symbol":"OP","symbol_native":"OP"},"AED":{"code":"AED","name":"United Arab Emirates Dirham","decimal_digits":2,"name_plural":"UAE dirhams","rounding":0,"symbol":"AED","symbol_native":"د.إ"},"BTN":{"code":"BTN","name":"Bhutanese Ngultrum","decimal_digits":2,"name_plural":"Bhutanese Ngultrum","rounding":0,"symbol":"Nu.","symbol_native":"Nu."},"MKD":{"code":"MKD","name":"Macedonian Denar","decimal_digits":2,"name_plural":"Macedonian denari","rounding":0,"symbol":"MKD","symbol_native":"MKD"},"MMK":{"code":"MMK","name":"Myanma Kyat","decimal_digits":0,"name_plural":"Myanma kyats","rounding":0,"symbol":"MMK","symbol_native":"K"},"MNT":{"code":"MNT","name":"Mongolian Tugrik","decimal_digits":2,"name_plural":"Mongolian Tugrik","rounding":0,"symbol":"₮","symbol_native":"₮"},"MOP":{"code":"MOP","name":"Macanese Pataca","decimal_digits":2,"name_plural":"Macanese patacas","rounding":0,"symbol":"MOP$","symbol_native":"MOP$"},"MRO":{"code":"MRO","name":"Mauritanian ouguiya","decimal_digits":2,"name_plural":"Mauritanian ouguiyas","rounding":0,"symbol":"UM","symbol_native":"UM"},"MUR":{"code":"MUR","name":"Mauritian Rupee","decimal_digits":0,"name_plural":"Mauritian rupees","rounding":0,"symbol":"MURs","symbol_native":"MURs"},"MVR":{"code":"MVR","name":"Maldivian Rufiyaa","decimal_digits":2,"name_plural":"Maldivian Rufiyaa","rounding":0,"symbol":"MRf","symbol_native":"Rf"},"MWK":{"code":"MWK","name":"Malawian Kwacha","decimal_digits":2,"name_plural":"Malawian Kwacha","rounding":0,"symbol":"MK","symbol_native":"MK"},"MXN":{"code":"MXN","name":"Mexican Peso","decimal_digits":2,"name_plural":"Mexican pesos","rounding":0,"symbol":"MX$","symbol_native":"$"},"MZN":{"code":"MZN","name":"Mozambican Metical","decimal_digits":2,"name_plural":"Mozambican meticals","rounding":0,"symbol":"MTn","symbol_native":"MTn"},"NAD":{"code":"NAD","name":"Namibian Dollar","decimal_digits":2,"name_plural":"Namibian dollars","rounding":0,"symbol":"N$","symbol_native":"N$"},"NGN":{"code":"NGN","name":"Nigerian Naira","decimal_digits":2,"name_plural":"Nigerian nairas","rounding":0,"symbol":"₦","symbol_native":"₦"},"NIO":{"code":"NIO","name":"Nicaraguan Córdoba","decimal_digits":2,"name_plural":"Nicaraguan córdobas","rounding":0,"symbol":"C$","symbol_native":"C$"},"NOK":{"code":"NOK","name":"Norwegian Krone","decimal_digits":2,"name_plural":"Norwegian kroner","rounding":0,"symbol":"Nkr","symbol_native":"kr"},"NPR":{"code":"NPR","name":"Nepalese Rupee","decimal_digits":2,"name_plural":"Nepalese rupees","rounding":0,"symbol":"NPRs","symbol_native":"नेरू"},"NZD":{"code":"NZD","name":"New Zealand Dollar","decimal_digits":2,"name_plural":"New Zealand dollars","rounding":0,"symbol":"NZ$","symbol_native":"$"},"OMR":{"code":"OMR","name":"Omani Rial","decimal_digits":3,"name_plural":"Omani rials","rounding":0,"symbol":"OMR","symbol_native":"ر.ع.‏"},"PAB":{"code":"PAB","name":"Panamanian Balboa","decimal_digits":2,"name_plural":"Panamanian balboas","rounding":0,"symbol":"B/.","symbol_native":"B/."},"PEN":{"code":"PEN","name":"Peruvian Nuevo Sol","decimal_digits":2,"name_plural":"Peruvian nuevos soles","rounding":0,"symbol":"S/.","symbol_native":"S/."},"PGK":{"code":"PGK","name":"Papua New Guinean Kina","decimal_digits":2,"name_plural":"Papua New Guinean Kina","rounding":0,"symbol":"K","symbol_native":"K"},"PHP":{"code":"PHP","name":"Philippine Peso","decimal_digits":2,"name_plural":"Philippine pesos","rounding":0,"symbol":"₱","symbol_native":"₱"},"PKR":{"code":"PKR","name":"Pakistani Rupee","decimal_digits":0,"name_plural":"Pakistani rupees","rounding":0,"symbol":"PKRs","symbol_native":"₨"},"PLN":{"code":"PLN","name":"Polish Zloty","decimal_digits":2,"name_plural":"Polish zlotys","rounding":0,"symbol":"zł","symbol_native":"zł"},"PYG":{"code":"PYG","name":"Paraguayan Guarani","decimal_digits":0,"name_plural":"Paraguayan guaranis","rounding":0,"symbol":"₲","symbol_native":"₲"},"QAR":{"code":"QAR","name":"Qatari Rial","decimal_digits":2,"name_plural":"Qatari rials","rounding":0,"symbol":"QR","symbol_native":"ر.ق.‏"},"RON":{"code":"RON","name":"Romanian Leu","decimal_digits":2,"name_plural":"Romanian lei","rounding":0,"symbol":"RON","symbol_native":"RON"},"RSD":{"code":"RSD","name":"Serbian Dinar","decimal_digits":0,"name_plural":"Serbian dinars","rounding":0,"symbol":"din.","symbol_native":"дин."},"RUB":{"code":"RUB","name":"Russian Ruble","decimal_digits":2,"name_plural":"Russian rubles","rounding":0,"symbol":"RUB","symbol_native":"руб."},"RWF":{"code":"RWF","name":"Rwandan Franc","decimal_digits":0,"name_plural":"Rwandan francs","rounding":0,"symbol":"RWF","symbol_native":"FR"},"SAR":{"code":"SAR","name":"Saudi Riyal","decimal_digits":2,"name_plural":"Saudi riyals","rounding":0,"symbol":"SR","symbol_native":"ر.س.‏"},"SCR":{"code":"SCR","name":"Seychellois Rupee","decimal_digits":2,"name_plural":"Seychellois Rupees","rounding":0,"symbol":"SRe","symbol_native":"SR"},"SDG":{"code":"SDG","name":"Sudanese Pound","decimal_digits":2,"name_plural":"Sudanese pounds","rounding":0,"symbol":"SDG","symbol_native":"SDG"},"SEK":{"code":"SEK","name":"Swedish Krona","decimal_digits":2,"name_plural":"Swedish kronor","rounding":0,"symbol":"Skr","symbol_native":"kr"},"SGD":{"code":"SGD","name":"Singapore Dollar","decimal_digits":2,"name_plural":"Singapore dollars","rounding":0,"symbol":"S$","symbol_native":"$"},"SHP":{"code":"SHP","name":"Saint Helena Pound","decimal_digits":2,"name_plural":"Saint Helena Pounds","rounding":0,"symbol":"£","symbol_native":"£"},"SLL":{"code":"SLL","name":"Sierra Leonean Leone","decimal_digits":2,"name_plural":"Sierra Leonean Leone","rounding":0,"symbol":"Le","symbol_native":"Le"},"SOS":{"code":"SOS","name":"Somali Shilling","decimal_digits":0,"name_plural":"Somali shillings","rounding":0,"symbol":"Ssh","symbol_native":"Ssh"},"SRD":{"code":"SRD","name":"Surinamese Dollar","decimal_digits":2,"name_plural":"Surinamese Dollar","rounding":0,"symbol":"$","symbol_native":"$"},"STD":{"code":"STD","name":"São Tomé and Príncipe dobra","decimal_digits":2,"name_plural":"São Tomé and Príncipe dobras","rounding":0,"symbol":"Db","symbol_native":"Db"},"SVC":{"code":"SVC","name":"Salvadoran Colón","decimal_digits":2,"name_plural":"Salvadoran Colón","rounding":0,"symbol":"₡","symbol_native":"₡"},"SYP":{"code":"SYP","name":"Syrian Pound","decimal_digits":0,"name_plural":"Syrian pounds","rounding":0,"symbol":"SY£","symbol_native":"ل.س.‏"},"SZL":{"code":"SZL","name":"Swazi Lilangeni","decimal_digits":2,"name_plural":"Swazi Lilangeni","rounding":0,"symbol":"L","symbol_native":"E‏"},"THB":{"code":"THB","name":"Thai Baht","decimal_digits":2,"name_plural":"Thai baht","rounding":0,"symbol":"฿","symbol_native":"฿"},"TJS":{"code":"TJS","name":"Tajikistani Somoni","decimal_digits":2,"name_plural":"Tajikistani Somoni","rounding":0,"symbol":"TJS","symbol_native":"TJS"},"TMT":{"code":"TMT","name":"Turkmenistani Manat","decimal_digits":2,"name_plural":"Turkmenistani Manat","rounding":0,"symbol":"T","symbol_native":"T‏"},"TND":{"code":"TND","name":"Tunisian Dinar","decimal_digits":3,"name_plural":"Tunisian dinars","rounding":0,"symbol":"DT","symbol_native":"د.ت.‏"},"TOP":{"code":"TOP","name":"Tongan Paʻanga","decimal_digits":2,"name_plural":"Tongan paʻanga","rounding":0,"symbol":"T$","symbol_native":"T$"},"TRY":{"code":"TRY","name":"Turkish Lira","decimal_digits":2,"name_plural":"Turkish Lira","rounding":0,"symbol":"TL","symbol_native":"TL"},"TTD":{"code":"TTD","name":"Trinidad and Tobago Dollar","decimal_digits":2,"name_plural":"Trinidad and Tobago dollars","rounding":0,"symbol":"TT$","symbol_native":"$"},"TWD":{"code":"TWD","name":"New Taiwan Dollar","decimal_digits":2,"name_plural":"New Taiwan dollars","rounding":0,"symbol":"NT$","symbol_native":"NT$"},"TZS":{"code":"TZS","name":"Tanzanian Shilling","decimal_digits":0,"name_plural":"Tanzanian shillings","rounding":0,"symbol":"TSh","symbol_native":"TSh"},"UAH":{"code":"UAH","name":"Ukrainian Hryvnia","decimal_digits":2,"name_plural":"Ukrainian hryvnias","rounding":0,"symbol":"₴","symbol_native":"₴"},"UGX":{"code":"UGX","name":"Ugandan Shilling","decimal_digits":0,"name_plural":"Ugandan shillings","rounding":0,"symbol":"USh","symbol_native":"USh"},"USD":{"code":"USD","name":"US Dollar","decimal_digits":2,"name_plural":"US dollars","rounding":0,"symbol":"$","symbol_native":"$"},"UYU":{"code":"UYU","name":"Uruguayan Peso","decimal_digits":2,"name_plural":"Uruguayan pesos","rounding":0,"symbol":"$U","symbol_native":"$"},"VEF":{"code":"VEF","name":"Venezuelan Bolívar","decimal_digits":2,"name_plural":"Venezuelan bolívars","rounding":0,"symbol":"Bs.F.","symbol_native":"Bs.F."},"VND":{"code":"VND","name":"Vietnamese Dong","decimal_digits":0,"name_plural":"Vietnamese dong","rounding":0,"symbol":"₫","symbol_native":"₫"},"VUV":{"code":"VUV","name":"Vanuatu Vatu","decimal_digits":0,"name_plural":"Vanuatu Vatu","rounding":0,"symbol":"VUV","symbol_native":"VT"},"WST":{"code":"WST","name":"Samoan Tala","decimal_digits":2,"name_plural":"Samoan Tala","rounding":0,"symbol":"WS$","symbol_native":"T"},"XAF":{"code":"XAF","name":"CFA Franc BEAC","decimal_digits":0,"name_plural":"CFA francs BEAC","rounding":0,"symbol":"FCFA","symbol_native":"FCFA"},"EGP":{"code":"EGP","name":"Egyptian Pound","decimal_digits":2,"name_plural":"Egyptian pounds","rounding":0,"symbol":"EGP","symbol_native":"ج.م.‏"},"INR":{"code":"INR","name":"Indian Rupee","decimal_digits":2,"name_plural":"Indian rupees","rounding":0,"symbol":"Rs","symbol_native":"টকা"},"LYD":{"code":"LYD","name":"Libyan Dinar","decimal_digits":3,"name_plural":"Libyan dinars","rounding":0,"symbol":"LD","symbol_native":"د.ل.‏"},"MGA":{"code":"MGA","name":"Malagasy Ariary","decimal_digits":0,"name_plural":"Malagasy Ariaries","rounding":0,"symbol":"MGA","symbol_native":"MGA"},"MYR":{"code":"MYR","name":"Malaysian Ringgit","decimal_digits":2,"name_plural":"Malaysian ringgits","rounding":0,"symbol":"RM","symbol_native":"RM"},"SBD":{"code":"SBD","name":"Solomon Islands Dollar","decimal_digits":2,"name_plural":"Solomon Islands Dollars","rounding":0,"symbol":"SI$","symbol_native":"$"},"UZS":{"code":"UZS","name":"Uzbekistan Som","decimal_digits":0,"name_plural":"Uzbekistan som","rounding":0,"symbol":"UZS","symbol_native":"UZS"}}')
    WITH (Code varchar(50) '$.code')`

I need to parse the Code and the Name into a table.
The with clause did not work:

WITH (Code varchar(50) '$.code')

2

Answers


  1. Consider:

    DECLARE @json NVARCHAR(MAX) = '{"AFN":{"code":"AFN","name":"Afghan Afghani","decimal_digits":0,"name_plural":"Afghan Afghanis","rounding":0,"symbol":"Af","symbol_native":"؋"},"ALL":{"code":"ALL","name":"Albanian Lek","decimal_digits":0,"name_plural":"Albanian lekë","rounding":0,"symbol":"ALL","symbol_native":"Lek"},"AMD":{"code":"AMD","name":"Armenian Dram","decimal_digits":0,"name_plural":"Armenian drams","rounding":0,"symbol":"AMD","symbol_native":"դր."},"ANG":{"code":"ANG","name":"NL Antillean Guilder","decimal_digits":2,"name_plural":"NL Antillean Guilders","rounding":0,"symbol":"ƒ","symbol_native":"NAƒ"},"AOA":{"code":"AOA","name":"Angolan Kwanza","decimal_digits":2,"name_plural":"Angolan Kwanza","rounding":0,"symbol":"Kz","symbol_native":"Kz"},"ARS":{"code":"ARS","name":"Argentine Peso","decimal_digits":2,"name_plural":"Argentine pesos","rounding":0,"symbol":"AR$","symbol_native":"$"},"AUD":{"code":"AUD","name":"Australian Dollar","decimal_digits":2,"name_plural":"Australian dollars","rounding":0,"symbol":"AU$","symbol_native":"$"},"AWG":{"code":"AWG","name":"Aruban Florin","decimal_digits":2,"name_plural":"Aruban Florin","rounding":0,"symbol":"Afl.","symbol_native":"Afl."},"AZN":{"code":"AZN","name":"Azerbaijani Manat","decimal_digits":2,"name_plural":"Azerbaijani manats","rounding":0,"symbol":"man.","symbol_native":"ман."},"BAM":{"code":"BAM","name":"Bosnia-Herzegovina Convertible Mark","decimal_digits":2,"name_plural":"Bosnia-Herzegovina convertible marks","rounding":0,"symbol":"KM","symbol_native":"KM"},"BBD":{"code":"BBD","name":"Barbadian Dollar","decimal_digits":2,"name_plural":"Barbadian Dollars","rounding":0,"symbol":"Bds$","symbol_native":"$"},"BDT":{"code":"BDT","name":"Bangladeshi Taka","decimal_digits":2,"name_plural":"Bangladeshi takas","rounding":0,"symbol":"Tk","symbol_native":"৳"},"BGN":{"code":"BGN","name":"Bulgarian Lev","decimal_digits":2,"name_plural":"Bulgarian leva","rounding":0,"symbol":"BGN","symbol_native":"лв."},"BHD":{"code":"BHD","name":"Bahraini Dinar","decimal_digits":3,"name_plural":"Bahraini dinars","rounding":0,"symbol":"BD","symbol_native":"د.ب.‏"},"BIF":{"code":"BIF","name":"Burundian Franc","decimal_digits":0,"name_plural":"Burundian francs","rounding":0,"symbol":"FBu","symbol_native":"FBu"},"BMD":{"code":"BMD","name":"Bermudan Dollar","decimal_digits":2,"name_plural":"Bermudan Dollars","rounding":0,"symbol":"BD$","symbol_native":"$"},"BND":{"code":"BND","name":"Brunei Dollar","decimal_digits":2,"name_plural":"Brunei dollars","rounding":0,"symbol":"BN$","symbol_native":"$"},"BOB":{"code":"BOB","name":"Bolivian Boliviano","decimal_digits":2,"name_plural":"Bolivian bolivianos","rounding":0,"symbol":"Bs","symbol_native":"Bs"},"BRL":{"code":"BRL","name":"Brazilian Real","decimal_digits":2,"name_plural":"Brazilian reals","rounding":0,"symbol":"R$","symbol_native":"R$"},"BSD":{"code":"BSD","name":"Bahamian Dollar","decimal_digits":2,"name_plural":"Bahamian Dollars","rounding":0,"symbol":"B$","symbol_native":"$"},"BWP":{"code":"BWP","name":"Botswanan Pula","decimal_digits":2,"name_plural":"Botswanan pulas","rounding":0,"symbol":"BWP","symbol_native":"P"},"BYN":{"code":"BYN","name":"Belarusian ruble","decimal_digits":2,"name_plural":"Belarusian rubles","rounding":0,"symbol":"Br","symbol_native":"Br"},"BYR":{"code":"BYR","name":"Belarusian Ruble","decimal_digits":0,"name_plural":"Belarusian rubles","rounding":0,"symbol":"BYR","symbol_native":"BYR"},"BZD":{"code":"BZD","name":"Belize Dollar","decimal_digits":2,"name_plural":"Belize dollars","rounding":0,"symbol":"BZ$","symbol_native":"$"},"CAD":{"code":"CAD","name":"Canadian Dollar","decimal_digits":2,"name_plural":"Canadian dollars","rounding":0,"symbol":"CA$","symbol_native":"$"},"CDF":{"code":"CDF","name":"Congolese Franc","decimal_digits":2,"name_plural":"Congolese francs","rounding":0,"symbol":"CDF","symbol_native":"FrCD"},"CHF":{"code":"CHF","name":"Swiss Franc","decimal_digits":2,"name_plural":"Swiss francs","rounding":0,"symbol":"CHF","symbol_native":"CHF"},"CLF":{"code":"CLF","name":"Unidad de Fomento","decimal_digits":2,"name_plural":"Unidad de Fomentos","rounding":0,"symbol":"UF","symbol_native":"UF"},"CLP":{"code":"CLP","name":"Chilean Peso","decimal_digits":0,"name_plural":"Chilean pesos","rounding":0,"symbol":"CL$","symbol_native":"$"},"CNY":{"code":"CNY","name":"Chinese Yuan","decimal_digits":2,"name_plural":"Chinese yuan","rounding":0,"symbol":"CN¥","symbol_native":"CN¥"},"COP":{"code":"COP","name":"Coombian Peso","decimal_digits":0,"name_plural":"Colombian pesos","rounding":0,"symbol":"CO$","symbol_native":"$"},"CRC":{"code":"CRC","name":"Costa Rican Colón","decimal_digits":0,"name_plural":"Costa Rican colóns","rounding":0,"symbol":"₡","symbol_native":"₡"},"CUC":{"code":"CUC","name":"Cuban Convertible Peso","decimal_digits":2,"name_plural":"Cuban Convertible Peso","rounding":0,"symbol":"CUC$","symbol_native":"$"},"CUP":{"code":"CUP","name":"Cuban Peso","decimal_digits":2,"name_plural":"Cuban Peso","rounding":0,"symbol":"$MN","symbol_native":"$"},"CVE":{"code":"CVE","name":"Cape Verdean Escudo","decimal_digits":2,"name_plural":"Cape Verdean escudos","rounding":0,"symbol":"CV$","symbol_native":"CV$"},"CZK":{"code":"CZK","name":"Czech Republic Koruna","decimal_digits":2,"name_plural":"Czech Republic korunas","rounding":0,"symbol":"Kč","symbol_native":"Kč"},"DJF":{"code":"DJF","name":"Djiboutian Franc","decimal_digits":0,"name_plural":"Djiboutian francs","rounding":0,"symbol":"Fdj","symbol_native":"Fdj"},"DKK":{"code":"DKK","name":"Danish Krone","decimal_digits":2,"name_plural":"Danish kroner","rounding":0,"symbol":"Dkr","symbol_native":"kr"},"DOP":{"code":"DOP","name":"Dominican Peso","decimal_digits":2,"name_plural":"Dominican pesos","rounding":0,"symbol":"RD$","symbol_native":"RD$"},"DZD":{"code":"DZD","name":"Algerian Dinar","decimal_digits":2,"name_plural":"Algerian dinars","rounding":0,"symbol":"DA","symbol_native":"د.ج.‏"},"ERN":{"code":"ERN","name":"Eritrean Nakfa","decimal_digits":2,"name_plural":"Eritrean nakfas","rounding":0,"symbol":"Nfk","symbol_native":"Nfk"},"ETB":{"code":"ETB","name":"Ethiopian Birr","decimal_digits":2,"name_plural":"Ethiopian birrs","rounding":0,"symbol":"Br","symbol_native":"Br"},"EUR":{"code":"EUR","name":"Euro","decimal_digits":2,"name_plural":"Euros","rounding":0,"symbol":"€","symbol_native":"€"},"FJD":{"code":"FJD","name":"Fijian Dollar","decimal_digits":2,"name_plural":"Fijian Dollar","rounding":0,"symbol":"FJ$","symbol_native":"$"},"FKP":{"code":"FKP","name":"Falkland Islands Pound","decimal_digits":2,"name_plural":"Falkland Islands Pound","rounding":0,"symbol":"FK£","symbol_native":"£"},"GBP":{"code":"GBP","name":"British Pound Sterling","decimal_digits":2,"name_plural":"British pounds sterling","rounding":0,"symbol":"£","symbol_native":"£"},"GEL":{"code":"GEL","name":"Georgian Lari","decimal_digits":2,"name_plural":"Georgian laris","rounding":0,"symbol":"GEL","symbol_native":"GEL"},"GGP":{"code":"GGP","name":"Guernsey pound","decimal_digits":2,"name_plural":"Guernsey pounds","rounding":0,"symbol":"£","symbol_native":"£"},"GHS":{"code":"GHS","name":"Ghanaian Cedi","decimal_digits":2,"name_plural":"Ghanaian cedis","rounding":0,"symbol":"GH₵","symbol_native":"GH₵"},"GIP":{"code":"GIP","name":"Gibraltar Pound","decimal_digits":2,"name_plural":"Gibraltar Pounds","rounding":0,"symbol":"£","symbol_native":"£"},"GMD":{"code":"GMD","name":"Gambian Dalasi","decimal_digits":2,"name_plural":"Gambian Dalasi","rounding":0,"symbol":"D","symbol_native":"D"},"GNF":{"code":"GNF","name":"Guinean Franc","decimal_digits":0,"name_plural":"Guinean francs","rounding":0,"symbol":"FG","symbol_native":"FG"},"GTQ":{"code":"GTQ","name":"Guatemalan Quetzal","decimal_digits":2,"name_plural":"Guatemalan quetzals","rounding":0,"symbol":"GTQ","symbol_native":"Q"},"GYD":{"code":"GYD","name":"Guyanaese Dollar","decimal_digits":2,"name_plural":"Guyanaese Dollar","rounding":0,"symbol":"G$","symbol_native":"$"},"HKD":{"code":"HKD","name":"Hong Kong Dollar","decimal_digits":2,"name_plural":"Hong Kong dollars","rounding":0,"symbol":"HK$","symbol_native":"$"},"HNL":{"code":"HNL","name":"Honduran Lempira","decimal_digits":2,"name_plural":"Honduran lempiras","rounding":0,"symbol":"HNL","symbol_native":"L"},"HRK":{"code":"HRK","name":"Croatian Kuna","decimal_digits":2,"name_plural":"Croatian kunas","rounding":0,"symbol":"kn","symbol_native":"kn"},"HTG":{"code":"HTG","name":"Haitian Gourde","decimal_digits":2,"name_plural":"Haitian Gourde","rounding":0,"symbol":"G","symbol_native":"G"},"HUF":{"code":"HUF","name":"Hungarian Forint","decimal_digits":0,"name_plural":"Hungarian forints","rounding":0,"symbol":"Ft","symbol_native":"Ft"},"IDR":{"code":"IDR","name":"Indonesian Rupiah","decimal_digits":0,"name_plural":"Indonesian rupiahs","rounding":0,"symbol":"Rp","symbol_native":"Rp"},"ILS":{"code":"ILS","name":"Israeli New Sheqel","decimal_digits":2,"name_plural":"Israeli new sheqels","rounding":0,"symbol":"₪","symbol_native":"₪"},"IMP":{"code":"IMP","name":"Manx pound","decimal_digits":2,"name_plural":"Manx pounds","rounding":0,"symbol":"£","symbol_native":"£"},"IQD":{"code":"IQD","name":"Iraqi Dinar","decimal_digits":0,"name_plural":"Iraqi dinars","rounding":0,"symbol":"IQD","symbol_native":"د.ع.‏"},"IRR":{"code":"IRR","name":"Iranian Rial","decimal_digits":0,"name_plural":"Iranian rials","rounding":0,"symbol":"IRR","symbol_native":"﷼"},"ISK":{"code":"ISK","name":"Icelandic Króna","decimal_digits":0,"name_plural":"Icelandic krónur","rounding":0,"symbol":"Ikr","symbol_native":"kr"},"JEP":{"code":"JEP","name":"Jersey pound","decimal_digits":2,"name_plural":"Jersey pound","rounding":0,"symbol":"£","symbol_native":"£"},"JMD":{"code":"JMD","name":"Jamaican Dollar","decimal_digits":2,"name_plural":"Jamaican dollars","rounding":0,"symbol":"J$","symbol_native":"$"},"JOD":{"code":"JOD","name":"Jordanian Dinar","decimal_digits":3,"name_plural":"Jordanian dinars","rounding":0,"symbol":"JD","symbol_native":"د.أ.‏"},"JPY":{"code":"JPY","name":"Japanese Yen","decimal_digits":0,"name_plural":"Japanese yen","rounding":0,"symbol":"¥","symbol_native":"¥"},"KES":{"code":"KES","name":"Kenyan Shilling","decimal_digits":2,"name_plural":"Kenyan shillings","rounding":0,"symbol":"Ksh","symbol_native":"Ksh"},"KGS":{"code":"KGS","name":"Kyrgystani Som","decimal_digits":2,"name_plural":"Kyrgystani Som","rounding":0,"symbol":"KGS","symbol_native":"KGS"},"KHR":{"code":"KHR","name":"Cambodian Riel","decimal_digits":2,"name_plural":"Cambodian riels","rounding":0,"symbol":"KHR","symbol_native":"៛"},"KMF":{"code":"KMF","name":"Comorian Franc","decimal_digits":0,"name_plural":"Comorian francs","rounding":0,"symbol":"CF","symbol_native":"FC"},"KPW":{"code":"KPW","name":"North Korean Won","decimal_digits":2,"name_plural":"North Korean Won","rounding":0,"symbol":"₩","symbol_native":"₩"},"KRW":{"code":"KRW","name":"South Korean Won","decimal_digits":0,"name_plural":"South Korean won","rounding":0,"symbol":"₩","symbol_native":"₩"},"KWD":{"code":"KWD","name":"Kuwaiti Dinar","decimal_digits":3,"name_plural":"Kuwaiti dinars","rounding":0,"symbol":"KD","symbol_native":"د.ك.‏"},"KYD":{"code":"KYD","name":"Cayman Islands Dollar","decimal_digits":2,"name_plural":"Cayman Islands Dollar","rounding":0,"symbol":"CI$","symbol_native":"$‏"},"KZT":{"code":"KZT","name":"Kazakhstani Tenge","decimal_digits":2,"name_plural":"Kazakhstani tenges","rounding":0,"symbol":"KZT","symbol_native":"тңг."},"LAK":{"code":"LAK","name":"Laotian Kip","decimal_digits":0,"name_plural":"Laotian Kip","rounding":0,"symbol":"₭N","symbol_native":"₭‏‏"},"LBP":{"code":"LBP","name":"Lebanese Pound","decimal_digits":0,"name_plural":"Lebanese pounds","rounding":0,"symbol":"LB£","symbol_native":"ل.ل.‏"},"LKR":{"code":"LKR","name":"Sri Lankan Rupee","decimal_digits":2,"name_plural":"Sri Lankan rupees","rounding":0,"symbol":"SLRs","symbol_native":"SL Re"},"LRD":{"code":"LRD","name":"Liberian Dollar","decimal_digits":2,"name_plural":"Liberian Dollar","rounding":0,"symbol":"LD$","symbol_native":"L$"},"LSL":{"code":"LSL","name":"Lesotho Loti","decimal_digits":2,"name_plural":"Lesotho Loti","rounding":0,"symbol":"L","symbol_native":"M"},"LTL":{"code":"LTL","name":"Lithuanian Litas","decimal_digits":2,"name_plural":"Lithuanian litai","rounding":0,"symbol":"Lt","symbol_native":"Lt"},"LVL":{"code":"LVL","name":"Latvian Lats","decimal_digits":2,"name_plural":"Latvian lati","rounding":0,"symbol":"Ls","symbol_native":"Ls"},"MAD":{"code":"MAD","name":"Moroccan Dirham","decimal_digits":2,"name_plural":"Moroccan dirhams","rounding":0,"symbol":"MAD","symbol_native":"د.م.‏"},"MDL":{"code":"MDL","name":"Moldovan Leu","decimal_digits":2,"name_plural":"Moldovan lei","rounding":0,"symbol":"MDL","symbol_native":"MDL"},"XAG":{"code":"XAG","name":"Silver Ounce","decimal_digits":2,"name_plural":"Silver Ounces","rounding":0,"symbol":"XAG","symbol_native":"XAG"},"XAU":{"code":"XAU","name":"Gold Ounce","decimal_digits":2,"name_plural":"Gold Ounces","rounding":0,"symbol":"XAU","symbol_native":"XAU"},"XCD":{"code":"XCD","name":"East Caribbean Dollar","decimal_digits":2,"name_plural":"East Caribbean Dollars","rounding":0,"symbol":"EC$","symbol_native":"$"},"XDR":{"code":"XDR","name":"Special drawing rights","decimal_digits":2,"name_plural":"Special drawing rights","rounding":0,"symbol":"SDR","symbol_native":"SDR"},"XOF":{"code":"XOF","name":"CFA Franc BCEAO","decimal_digits":0,"name_plural":"CFA francs BCEAO","rounding":0,"symbol":"CFA","symbol_native":"CFA"},"XPF":{"code":"XPF","name":"CFP Franc","decimal_digits":0,"name_plural":"CFP francs","rounding":0,"symbol":"CFP","symbol_native":"CFP"},"YER":{"code":"YER","name":"Yemeni Rial","decimal_digits":0,"name_plural":"Yemeni rials","rounding":0,"symbol":"YR","symbol_native":"ر.ي.‏"},"ZAR":{"code":"ZAR","name":"South African Rand","decimal_digits":2,"name_plural":"South African rand","rounding":0,"symbol":"R","symbol_native":"R"},"ZMK":{"code":"ZMK","name":"Zambian Kwacha","decimal_digits":0,"name_plural":"Zambian kwachas","rounding":0,"symbol":"ZK","symbol_native":"ZK"},"ZMW":{"code":"ZMW","name":"Zambian Kwacha","decimal_digits":0,"name_plural":"Zambian kwachas","rounding":0,"symbol":"ZK","symbol_native":"ZK"},"ZWL":{"code":"ZWL","name":"Zimbabwean dollar","decimal_digits":2,"name_plural":"Zimbabwean dollars","rounding":0,"symbol":"ZWL","symbol_native":"$"},"XPT":{"code":"XPT","name":"Platinum Ounce","decimal_digits":6,"name_plural":"Platinum Ounces","rounding":0,"symbol":"XPT","symbol_native":"XPT"},"XPD":{"code":"XPD","name":"Palladium Ounce","decimal_digits":6,"name_plural":"Palladium Ounces","rounding":0,"symbol":"XPD","symbol_native":"XPD"},"BTC":{"code":"BTC","name":"Bitcoin","decimal_digits":8,"name_plural":"Bitcoins","rounding":0,"symbol":"₿","symbol_native":"₿"},"ETH":{"code":"ETH","name":"Ethereum","decimal_digits":18,"name_plural":"Ethereum","rounding":0,"symbol":"Ξ","symbol_native":"Ξ"},"BNB":{"code":"BNB","name":"Binance","decimal_digits":8,"name_plural":"Binance","rounding":0,"symbol":"BNB","symbol_native":"BNB"},"XRP":{"code":"XRP","name":"Ripple","decimal_digits":6,"name_plural":"Ripple","rounding":0,"symbol":"XRP","symbol_native":"XRP"},"SOL":{"code":"SOL","name":"Solana","decimal_digits":9,"name_plural":"Solana","rounding":0,"symbol":"SOL","symbol_native":"SOL"},"DOT":{"code":"DOT","name":"Polkadot","decimal_digits":10,"name_plural":"Polkadot","rounding":0,"symbol":"DOT","symbol_native":"DOT"},"AVAX":{"code":"AVAX","name":"Avalanche","decimal_digits":18,"name_plural":"Avalanche","rounding":0,"symbol":"AVAX","symbol_native":"AVAX"},"MATIC":{"code":"MATIC","name":"Matic Token","decimal_digits":18,"name_plural":"Matic Tokens","rounding":0,"symbol":"MATIC","symbol_native":"MATIC"},"LTC":{"code":"LTC","name":"Litecoin","decimal_digits":8,"name_plural":"Litecoins","rounding":0,"symbol":"Ł","symbol_native":"Ł"},"ADA":{"code":"ADA","name":"Cardano","decimal_digits":6,"name_plural":"Cardanos","rounding":0,"symbol":"ADA","symbol_native":"ADA"},"USDT":{"code":"USDT","name":"Tether","decimal_digits":2,"name_plural":"Tethers","rounding":0,"symbol":"USDT","symbol_native":"USDT"},"USDC":{"code":"USDC","name":"USD Coin","decimal_digits":2,"name_plural":"USD Coins","rounding":0,"symbol":"USDC","symbol_native":"USDC"},"DAI":{"code":"DAI","name":"Dai","decimal_digits":2,"name_plural":"Dais","rounding":0,"symbol":"DAI","symbol_native":"DAI"},"BUSD":{"code":"BUSD","name":"Binance USD","decimal_digits":8,"name_plural":"Binance USD","rounding":0,"symbol":"BUSD","symbol_native":"BUSD"},"ARB":{"code":"ARB","name":"Arbitrum","decimal_digits":8,"name_plural":"Arbitrums","rounding":0,"symbol":"ARB","symbol_native":"ARB"},"OP":{"code":"OP","name":"Optimism","decimal_digits":8,"name_plural":"Optimism","rounding":0,"symbol":"OP","symbol_native":"OP"},"AED":{"code":"AED","name":"United Arab Emirates Dirham","decimal_digits":2,"name_plural":"UAE dirhams","rounding":0,"symbol":"AED","symbol_native":"د.إ"},"BTN":{"code":"BTN","name":"Bhutanese Ngultrum","decimal_digits":2,"name_plural":"Bhutanese Ngultrum","rounding":0,"symbol":"Nu.","symbol_native":"Nu."},"MKD":{"code":"MKD","name":"Macedonian Denar","decimal_digits":2,"name_plural":"Macedonian denari","rounding":0,"symbol":"MKD","symbol_native":"MKD"},"MMK":{"code":"MMK","name":"Myanma Kyat","decimal_digits":0,"name_plural":"Myanma kyats","rounding":0,"symbol":"MMK","symbol_native":"K"},"MNT":{"code":"MNT","name":"Mongolian Tugrik","decimal_digits":2,"name_plural":"Mongolian Tugrik","rounding":0,"symbol":"₮","symbol_native":"₮"},"MOP":{"code":"MOP","name":"Macanese Pataca","decimal_digits":2,"name_plural":"Macanese patacas","rounding":0,"symbol":"MOP$","symbol_native":"MOP$"},"MRO":{"code":"MRO","name":"Mauritanian ouguiya","decimal_digits":2,"name_plural":"Mauritanian ouguiyas","rounding":0,"symbol":"UM","symbol_native":"UM"},"MUR":{"code":"MUR","name":"Mauritian Rupee","decimal_digits":0,"name_plural":"Mauritian rupees","rounding":0,"symbol":"MURs","symbol_native":"MURs"},"MVR":{"code":"MVR","name":"Maldivian Rufiyaa","decimal_digits":2,"name_plural":"Maldivian Rufiyaa","rounding":0,"symbol":"MRf","symbol_native":"Rf"},"MWK":{"code":"MWK","name":"Malawian Kwacha","decimal_digits":2,"name_plural":"Malawian Kwacha","rounding":0,"symbol":"MK","symbol_native":"MK"},"MXN":{"code":"MXN","name":"Mexican Peso","decimal_digits":2,"name_plural":"Mexican pesos","rounding":0,"symbol":"MX$","symbol_native":"$"},"MZN":{"code":"MZN","name":"Mozambican Metical","decimal_digits":2,"name_plural":"Mozambican meticals","rounding":0,"symbol":"MTn","symbol_native":"MTn"},"NAD":{"code":"NAD","name":"Namibian Dollar","decimal_digits":2,"name_plural":"Namibian dollars","rounding":0,"symbol":"N$","symbol_native":"N$"},"NGN":{"code":"NGN","name":"Nigerian Naira","decimal_digits":2,"name_plural":"Nigerian nairas","rounding":0,"symbol":"₦","symbol_native":"₦"},"NIO":{"code":"NIO","name":"Nicaraguan Córdoba","decimal_digits":2,"name_plural":"Nicaraguan córdobas","rounding":0,"symbol":"C$","symbol_native":"C$"},"NOK":{"code":"NOK","name":"Norwegian Krone","decimal_digits":2,"name_plural":"Norwegian kroner","rounding":0,"symbol":"Nkr","symbol_native":"kr"},"NPR":{"code":"NPR","name":"Nepalese Rupee","decimal_digits":2,"name_plural":"Nepalese rupees","rounding":0,"symbol":"NPRs","symbol_native":"नेरू"},"NZD":{"code":"NZD","name":"New Zealand Dollar","decimal_digits":2,"name_plural":"New Zealand dollars","rounding":0,"symbol":"NZ$","symbol_native":"$"},"OMR":{"code":"OMR","name":"Omani Rial","decimal_digits":3,"name_plural":"Omani rials","rounding":0,"symbol":"OMR","symbol_native":"ر.ع.‏"},"PAB":{"code":"PAB","name":"Panamanian Balboa","decimal_digits":2,"name_plural":"Panamanian balboas","rounding":0,"symbol":"B/.","symbol_native":"B/."},"PEN":{"code":"PEN","name":"Peruvian Nuevo Sol","decimal_digits":2,"name_plural":"Peruvian nuevos soles","rounding":0,"symbol":"S/.","symbol_native":"S/."},"PGK":{"code":"PGK","name":"Papua New Guinean Kina","decimal_digits":2,"name_plural":"Papua New Guinean Kina","rounding":0,"symbol":"K","symbol_native":"K"},"PHP":{"code":"PHP","name":"Philippine Peso","decimal_digits":2,"name_plural":"Philippine pesos","rounding":0,"symbol":"₱","symbol_native":"₱"},"PKR":{"code":"PKR","name":"Pakistani Rupee","decimal_digits":0,"name_plural":"Pakistani rupees","rounding":0,"symbol":"PKRs","symbol_native":"₨"},"PLN":{"code":"PLN","name":"Polish Zloty","decimal_digits":2,"name_plural":"Polish zlotys","rounding":0,"symbol":"zł","symbol_native":"zł"},"PYG":{"code":"PYG","name":"Paraguayan Guarani","decimal_digits":0,"name_plural":"Paraguayan guaranis","rounding":0,"symbol":"₲","symbol_native":"₲"},"QAR":{"code":"QAR","name":"Qatari Rial","decimal_digits":2,"name_plural":"Qatari rials","rounding":0,"symbol":"QR","symbol_native":"ر.ق.‏"},"RON":{"code":"RON","name":"Romanian Leu","decimal_digits":2,"name_plural":"Romanian lei","rounding":0,"symbol":"RON","symbol_native":"RON"},"RSD":{"code":"RSD","name":"Serbian Dinar","decimal_digits":0,"name_plural":"Serbian dinars","rounding":0,"symbol":"din.","symbol_native":"дин."},"RUB":{"code":"RUB","name":"Russian Ruble","decimal_digits":2,"name_plural":"Russian rubles","rounding":0,"symbol":"RUB","symbol_native":"руб."},"RWF":{"code":"RWF","name":"Rwandan Franc","decimal_digits":0,"name_plural":"Rwandan francs","rounding":0,"symbol":"RWF","symbol_native":"FR"},"SAR":{"code":"SAR","name":"Saudi Riyal","decimal_digits":2,"name_plural":"Saudi riyals","rounding":0,"symbol":"SR","symbol_native":"ر.س.‏"},"SCR":{"code":"SCR","name":"Seychellois Rupee","decimal_digits":2,"name_plural":"Seychellois Rupees","rounding":0,"symbol":"SRe","symbol_native":"SR"},"SDG":{"code":"SDG","name":"Sudanese Pound","decimal_digits":2,"name_plural":"Sudanese pounds","rounding":0,"symbol":"SDG","symbol_native":"SDG"},"SEK":{"code":"SEK","name":"Swedish Krona","decimal_digits":2,"name_plural":"Swedish kronor","rounding":0,"symbol":"Skr","symbol_native":"kr"},"SGD":{"code":"SGD","name":"Singapore Dollar","decimal_digits":2,"name_plural":"Singapore dollars","rounding":0,"symbol":"S$","symbol_native":"$"},"SHP":{"code":"SHP","name":"Saint Helena Pound","decimal_digits":2,"name_plural":"Saint Helena Pounds","rounding":0,"symbol":"£","symbol_native":"£"},"SLL":{"code":"SLL","name":"Sierra Leonean Leone","decimal_digits":2,"name_plural":"Sierra Leonean Leone","rounding":0,"symbol":"Le","symbol_native":"Le"},"SOS":{"code":"SOS","name":"Somali Shilling","decimal_digits":0,"name_plural":"Somali shillings","rounding":0,"symbol":"Ssh","symbol_native":"Ssh"},"SRD":{"code":"SRD","name":"Surinamese Dollar","decimal_digits":2,"name_plural":"Surinamese Dollar","rounding":0,"symbol":"$","symbol_native":"$"},"STD":{"code":"STD","name":"São Tomé and Príncipe dobra","decimal_digits":2,"name_plural":"São Tomé and Príncipe dobras","rounding":0,"symbol":"Db","symbol_native":"Db"},"SVC":{"code":"SVC","name":"Salvadoran Colón","decimal_digits":2,"name_plural":"Salvadoran Colón","rounding":0,"symbol":"₡","symbol_native":"₡"},"SYP":{"code":"SYP","name":"Syrian Pound","decimal_digits":0,"name_plural":"Syrian pounds","rounding":0,"symbol":"SY£","symbol_native":"ل.س.‏"},"SZL":{"code":"SZL","name":"Swazi Lilangeni","decimal_digits":2,"name_plural":"Swazi Lilangeni","rounding":0,"symbol":"L","symbol_native":"E‏"},"THB":{"code":"THB","name":"Thai Baht","decimal_digits":2,"name_plural":"Thai baht","rounding":0,"symbol":"฿","symbol_native":"฿"},"TJS":{"code":"TJS","name":"Tajikistani Somoni","decimal_digits":2,"name_plural":"Tajikistani Somoni","rounding":0,"symbol":"TJS","symbol_native":"TJS"},"TMT":{"code":"TMT","name":"Turkmenistani Manat","decimal_digits":2,"name_plural":"Turkmenistani Manat","rounding":0,"symbol":"T","symbol_native":"T‏"},"TND":{"code":"TND","name":"Tunisian Dinar","decimal_digits":3,"name_plural":"Tunisian dinars","rounding":0,"symbol":"DT","symbol_native":"د.ت.‏"},"TOP":{"code":"TOP","name":"Tongan Paʻanga","decimal_digits":2,"name_plural":"Tongan paʻanga","rounding":0,"symbol":"T$","symbol_native":"T$"},"TRY":{"code":"TRY","name":"Turkish Lira","decimal_digits":2,"name_plural":"Turkish Lira","rounding":0,"symbol":"TL","symbol_native":"TL"},"TTD":{"code":"TTD","name":"Trinidad and Tobago Dollar","decimal_digits":2,"name_plural":"Trinidad and Tobago dollars","rounding":0,"symbol":"TT$","symbol_native":"$"},"TWD":{"code":"TWD","name":"New Taiwan Dollar","decimal_digits":2,"name_plural":"New Taiwan dollars","rounding":0,"symbol":"NT$","symbol_native":"NT$"},"TZS":{"code":"TZS","name":"Tanzanian Shilling","decimal_digits":0,"name_plural":"Tanzanian shillings","rounding":0,"symbol":"TSh","symbol_native":"TSh"},"UAH":{"code":"UAH","name":"Ukrainian Hryvnia","decimal_digits":2,"name_plural":"Ukrainian hryvnias","rounding":0,"symbol":"₴","symbol_native":"₴"},"UGX":{"code":"UGX","name":"Ugandan Shilling","decimal_digits":0,"name_plural":"Ugandan shillings","rounding":0,"symbol":"USh","symbol_native":"USh"},"USD":{"code":"USD","name":"US Dollar","decimal_digits":2,"name_plural":"US dollars","rounding":0,"symbol":"$","symbol_native":"$"},"UYU":{"code":"UYU","name":"Uruguayan Peso","decimal_digits":2,"name_plural":"Uruguayan pesos","rounding":0,"symbol":"$U","symbol_native":"$"},"VEF":{"code":"VEF","name":"Venezuelan Bolívar","decimal_digits":2,"name_plural":"Venezuelan bolívars","rounding":0,"symbol":"Bs.F.","symbol_native":"Bs.F."},"VND":{"code":"VND","name":"Vietnamese Dong","decimal_digits":0,"name_plural":"Vietnamese dong","rounding":0,"symbol":"₫","symbol_native":"₫"},"VUV":{"code":"VUV","name":"Vanuatu Vatu","decimal_digits":0,"name_plural":"Vanuatu Vatu","rounding":0,"symbol":"VUV","symbol_native":"VT"},"WST":{"code":"WST","name":"Samoan Tala","decimal_digits":2,"name_plural":"Samoan Tala","rounding":0,"symbol":"WS$","symbol_native":"T"},"XAF":{"code":"XAF","name":"CFA Franc BEAC","decimal_digits":0,"name_plural":"CFA francs BEAC","rounding":0,"symbol":"FCFA","symbol_native":"FCFA"},"EGP":{"code":"EGP","name":"Egyptian Pound","decimal_digits":2,"name_plural":"Egyptian pounds","rounding":0,"symbol":"EGP","symbol_native":"ج.م.‏"},"INR":{"code":"INR","name":"Indian Rupee","decimal_digits":2,"name_plural":"Indian rupees","rounding":0,"symbol":"Rs","symbol_native":"টকা"},"LYD":{"code":"LYD","name":"Libyan Dinar","decimal_digits":3,"name_plural":"Libyan dinars","rounding":0,"symbol":"LD","symbol_native":"د.ل.‏"},"MGA":{"code":"MGA","name":"Malagasy Ariary","decimal_digits":0,"name_plural":"Malagasy Ariaries","rounding":0,"symbol":"MGA","symbol_native":"MGA"},"MYR":{"code":"MYR","name":"Malaysian Ringgit","decimal_digits":2,"name_plural":"Malaysian ringgits","rounding":0,"symbol":"RM","symbol_native":"RM"},"SBD":{"code":"SBD","name":"Solomon Islands Dollar","decimal_digits":2,"name_plural":"Solomon Islands Dollars","rounding":0,"symbol":"SI$","symbol_native":"$"},"UZS":{"code":"UZS","name":"Uzbekistan Som","decimal_digits":0,"name_plural":"Uzbekistan som","rounding":0,"symbol":"UZS","symbol_native":"UZS"}}'
    
    SELECT JSON_VALUE(value,'$.code') AS Code, JSON_VALUE(value,'$.name') AS Name
      FROM OPENJSON(@json,'$');
    
    Code Name
    AFN Afghan Afghani
    ALL Albanian Lek
    AMD Armenian Dram
    ANG NL Antillean Guilder
    AOA Angolan Kwanza
    MYR Malaysian Ringgit
    SBD Solomon Islands Dollar
    UZS Uzbekistan Som

    https://learn.microsoft.com/en-us/sql/t-sql/functions/openjson-transact-sql?view=sql-server-ver16

    Login or Signup to reply.
  2. Another method, enforcing data types and proper prefix N’…’ for the NVARCHAR(…) data type.

    SQL

    DECLARE @json NVARCHAR(MAX) = 
    N'{
        "AFN": {
            "code": "AFN",
            "name": "Afghan Afghani",
            "decimal_digits": 0,
            "name_plural": "Afghan Afghanis",
            "rounding": 0,
            "symbol": "Af",
            "symbol_native": "؋"
        },
        "ALL": {
            "code": "ALL",
            "name": "Albanian Lek",
            "decimal_digits": 0,
            "name_plural": "Albanian lekë",
            "rounding": 0,
            "symbol": "ALL",
            "symbol_native": "Lek"
        },
        "AMD": {
            "code": "AMD",
            "name": "Armenian Dram",
            "decimal_digits": 0,
            "name_plural": "Armenian drams",
            "rounding": 0,
            "symbol": "AMD",
            "symbol_native": "դր."
        },
        "ANG": {
            "code": "ANG",
            "name": "NL Antillean Guilder",
            "decimal_digits": 2,
            "name_plural": "NL Antillean Guilders",
            "rounding": 0,
            "symbol": "ƒ",
            "symbol_native": "NAƒ"
        },
        "ILS": {
            "code": "ILS",
            "name": "Israeli New Sheqel",
            "decimal_digits": 2,
            "name_plural": "Israeli new sheqels",
            "rounding": 0,
            "symbol": "₪",
            "symbol_native": "₪"
        }
    }';
    
    SELECT u.*
    FROM OPENJSON(@json) d
    CROSS APPLY OPENJSON(d.value)
    WITH
    (
       currency_code    CHAR(3)         '$.code',
       currency_name    NVARCHAR(200)   '$.name',
       symbol           NVARCHAR(20)    '$.symbol'
    ) AS u;
    

    Output

    currency_code currency_name symbol
    AFN Afghan Afghani Af
    ALL Albanian Lek ALL
    AMD Armenian Dram AMD
    ANG NL Antillean Guilder ƒ
    ILS Israeli New Sheqel
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search