Converting image fields to varchar(max)

28 views
Skip to first unread message

Zohar

unread,
Mar 31, 2025, 4:28:25 AMMar 31
to Migrated By Firefly
Hi all,  
We have some fields that are historically of the image type and contain text (converted from the Memo type in Magic).  
Unfortunately, we can't convert them to varchar(max) in the database, but sometimes we need to write SQL queries to display its text.  
Usually, we use this code to do it:  

It works great when the client's database is collated in Hebrew_CI_AS, but returns gibberish when the collation is Hebrew_100_CI_AI.  

Has anyone encountered this issue in the past and found a solution?

Zohar

unread,
Apr 1, 2025, 2:17:11 AMApr 1
to Migrated By Firefly
I noticed that my original post did not include the code I'm using, see here:
SUBSTRING(CAST(CAST(image_text AS VARBINARY(MAX)) AS VARCHAR(MAX)), 3, 65000)

Reply all
Reply to author
Forward
0 new messages