I have the following SQL select query which hashes a user ID using SHA256. I would like to further encode this hash to base64 so that it is easily readable by other applications such as Excel, which right now causes issues when parsing the hashed user ID's. How can I achieve this?
Select
cast(HASHBYTES('SHA2_256', cast(Users.UserID as nvarchar(10))) as varchar(50)) as UserID
FROM UserTable