开发者

How to convert a Roman value to integer in SQL Server?

开发者 https://www.devze.com 2023-01-30 00:55 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消