SQL Server Currency Conversion Table Build, Iterate Over Collations?
-
02-03-2021 - |
Question
Using MSSQL 2008.
I looked around a bit online for a table that maps ISO 4217 (http://en.wikipedia.org/wiki/ISO_4217) currency names to their respective symbols, so I could map "840" to "$". I didn't find anything so I am about to build my own.
Is there a way to iterate over the different collations in the server and pull out the currency symbol (maybe they are all in the same charcode position) so I can get the right character to go with the numeric value?
Thanks.
Solution
You'd use nvarchar to isolate yourself from code page (which is ASCII 128 to 255) pretty much
And this page maps 3 letter codes to unicode symbols: http://www.xe.com/symbols.php
The rest should be straightforward
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow