AnsweredAssumed Answered

Convert VARBINARY (BLOB) to Base64 String using T-SQL

Question asked by TLongSUGF on Jul 12, 2017
Latest reply on Jan 5, 2018 by TLongSUGF

I am trying to convert the attachment tables DATA tab (BLOB/VARBINARY) into Base64.  

 

USE UTILITIES
SELECT CAST(CAST('' as XML).value('xs:base64Binary(sql:column("DATA"))', 'VARBINARY(MAX)') AS NVARCHAR(MAX))

FROM FeatureClass_ATTACH_evw
WHERE REL_OBJECTID = '51'
go

 

Results:

 

"�က䙊䙉Ā ĀĀ"

 

 

Is there a way to convert the BLOB into Base64?

Outcomes