📅  最后修改于: 2022-03-11 15:05:08.189000             🧑  作者: Mango
--String to Base64
SELECT CAST('string' as varbinary(max)) FOR XML PATH(''), BINARY BASE64
--Base64 to String
SELECT CAST( CAST( 'c3RyaW5n' as XML ).value('.','varbinary(max)') AS varchar(max) )