Select
CAST(
CAST(N'' AS XML).value(
'xs:base64Binary("MA==")'
, 'VARBINARY(MAX)'
)
AS VARCHAR(MAX)
) ASCIIEncoding
;
Declare @Value nvarchar(10)
set @Value ='MA=='
Select
CAST(
CAST(N'' AS XML).value(
'xs:base64Binary("@Value")'
, 'VARBINARY(MAX)'
)
AS VARCHAR(MAX)
) ASCIIEncoding
;
收到错误
答案 0 :(得分:0)
这有效:
Declare @Value nvarchar(10)
set @Value ='MA=='
Select
CAST(
CAST(N'' AS XML).value(
'xs:base64Binary(sql:variable("@Value"))'
, 'VARBINARY(MAX)'
)
AS VARCHAR(MAX)
) ASCIIEncoding
;