开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜