How to convert a Roman value to integer in SQL Server?
I have say MDCCCLXXXVIII which is 1888 in Arabic number or D in Roman is 500 in Arabic or MIV is 1004, e开发者_Python百科tc.
In a single TQL Query how can this be achieved?
Thanks
Check out this set of UDF functions (see UDFs_Transact-SQL.zip). There is ROMANTOARAB function there that allows you to do this:
select ROMANTOARAB('MDCCCLXXXVIII') -- Displays 1888
Edit: Looks like the original Url has stopped working for some reason.. Luckily, I have that ZIP on my hard drive and just put it on Dropbox - you can download here.
精彩评论