T-SQL - Convert binary data to/from Base64 (or other string representation)

Viewed 16162

Is there a Microsoft T-SQL statement that will allow you to convert a binary data type (like image) to/from a string representation like Base64.

its easy enough in .net (Convert.ToBase64 & Convert.FromBase64) but is this possible using SQL alone, something like (obviously pseudocode)

SELECT CastAsBase64(binary_field) As Base64BinaryField
FROM   SomeTable
WHERE  ID = @ID
2 Answers
Related