Base-64 conversion in SQL Server

create function dbo.ConvertFromBase64String (@Base64Value varchar(max))returns varbinary(max)asbegin return cast(” as xml).value(‘xs:base64Binary(sql:variable(“@Base64Value”))’, ‘varbinary(max)’);end;gocreate function dbo.ConvertToBase64String (@BinaryValue varbinary(max))returns varchar(max)asbegin return cast(” as xml).value(‘xs:base64Binary(sql:variable(“@BinaryValue”))’,’varchar(max)’);end;godeclare @b varbinary(max) = cast(‘hello’ as […]

Base-64 conversion in SQL Server Read More