Hi Helmi
I would change
WHEN @FieldType IN ( 'Boolean', 'ChangedAt', 'ChangedBy', 'CreatedAt', 'CreatedBy', 'Currency', 'Decimal', 'EMail', 'Int32', 'String', 'TextHTML' )
THEN @FieldValue
to
WHEN @FieldType IN ( 'Boolean', 'ChangedAt', 'ChangedBy', 'CreatedAt', 'CreatedBy', 'Currency', 'Decimal', 'EMail', 'Int32', 'String')
THEN @FieldValue
WHEN @FieldType IN ('TextHTML' ) THEN dbo.StripTags (@FieldValue)
You will have to provide the function dbo.StripTags to remove the HTML (XML?) tags you don't want. As its most basic this could be a nested set of REPLACE function calls, for example
RETURN REPLACE (
REPLACE (@FieldValue, '
', ''),
'
', '')
Hope this helps
Richard