SQL convert string data in hexadecimal format into string text

后端 未结 3 1967
夕颜
夕颜 2021-01-21 17:33

I have a table which has a column X. X will be storing large text values in hex format. Now I want to convert hex to raw and validate the data. But when I am using the below que

3条回答
  •  误落风尘
    2021-01-21 17:40

    It seems that this works better for me.

    if exists (select * from dbo.sysobjects where name = 'HexToStr' and xtype = 'FN')
    drop function [dbo].[HexToStr]
    GO
    
    CREATE FUNCTION [dbo].[HexToStr] (@hexstring VARCHAR(max))
    RETURNS VARCHAR(max)
    
    AS
    
    begin
     return @hexstring
    end
    GO
    

提交回复
热议问题