Converting a String to HEX in SQL

后端 未结 5 1330
孤城傲影
孤城傲影 2020-12-01 21:34

I\'m looking for a way to transform a genuine string into it\'s hexadecimal value in SQL. I\'m looking something that is Informix-friendly but I would obviously prefer somet

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-01 22:11

    OLD Post but in my case I also had to remove the 0x part of the hex so I used the below code. (I'm using MS SQL)

    convert(varchar, convert(Varbinary(MAX), YOURSTRING),2)

提交回复
热议问题