Convert contact photo to string



Hi community!



Contact has a colmn called "ContactPhoto" which returns System.Byte[].

I need this to be a string for a view that I'm creating.



this is what I tried:

 

SELECT Id, ContactPhoto,
	cast('' as xml).value('xs:base64Binary(sql:column("ct.ContactPhoto"))', 
	'varchar(max)') AS UsrContactPhoto
	FROM contact ct

which returns me an empty string:

https://prnt.sc/po1qe8

 

Any idea how I can convert it?



Thanks in advance!

File attachments
Like 0

Like

0 comments
Show all comments