I am trying to convert base64 to Binary in SQL, but I am not getting the proper results I need. The string I am testing is QQ==
.
I can convert to varbinary
fine, but I need the actual binary output.
Using the following code I get the value 0x41
but I need the value 01000001
.
Select CAST(N'' as xml).value('xs:base64Binary("QQ==")','varbinary(20)')
Is it possible to get the exact Binary from base64?