We are using a 3rd party application (i.e. I have no control over) that is storing RTF data as SQL Server's Image
data type in SQL Server 2016. I am fully aware that Microsoft intends to depreciate image
datatype, but as stated this is a 3rd party application.
My issue is I need to extract the actual RTF text data that is stored - is this even possible? I have SQL Server and/or SSIS to do this. The column in question is called NoteText
; I have tried casting as varbinary
then casting to varchar
like this:
SELECT CAST(CAST(NoteText AS varbinary(max)) AS varchar(max)) AS test1
FROM Notes
which does get me on the right path as it produces:
{\rtf1\ansi\ansicpg1252\deff0\deflang2057{\fonttbl{\f0\fnil\fcharset0 Tahoma;}} \viewkind4\uc1\pard\f0\fs20 Useful Text I need\par }
However, I'm just interested in the:
Useful Text I need
from the result.
Within SSIS, I did try and use the Export Column transformation that did produce a rtf file but it was just full of unreadable characters.
Thank you in advance for any advice or tips.