This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- BTOA Encode the text string | |
SELECT CAST(N'' AS XML).value( | |
'xs:base64Binary(xs:hexBinary(sql:column("bin")))', | |
'VARCHAR(MAX)' | |
) Base64Encoding | |
FROM ( | |
SELECT CAST('StoredValue=' + CAST(1213 as VARCHAR(30)) + '' AS VARBINARY(MAX)) AS BIN) | |
AS EncryptedStudentId; | |
-- ATOB Decode the Base64-encoded string |
OlderNewer