We encountered an xml issue during the poc of babelfish migration, how to rewrite a user define function based on 64-bit encryption that is very common in sql server.
The following code you can find on many web site
CREATE FUNCTION [dbo].[FnBase64Encode](@src varchar(max))
RETURNS VARCHAR(max)
as
begin
declare @bin varbinary(max)
set @bin=Convert(varbinary(max), @src)
return cast(N'' as xml).value('xs:base64Binary(xs:hexBinary(sql:variable("@bin")))', 'varchar(max)')
end
GO
We know that the current version of babelfish(1.2.1) does not support xml methods such as xml.node and xml.value, is there any solution or sample code for this case?