Base64 encoding in SQL Server 2005 T-SQL

后端 未结 10 1022
傲寒
傲寒 2020-11-22 10:06

I\'d like to write a T-SQL query where I encode a string as a Base64 string. Surprisingly, I can\'t find any native T-SQL functions for doing Base64 encoding. Does a nativ

10条回答
  •  日久生厌
    2020-11-22 10:13

    I did a script to convert an existing hash encoded in base64 to decimal, it may be useful:

    SELECT LOWER(SUBSTRING(CONVERT(NVARCHAR(42), CAST( [COLUMN_NAME] as XML ).value('.','varbinary(max)'), 1), 3, 40)) from TABLE
    

提交回复
热议问题