Hi @Remo522 ,
What data type is your source column?
Is it XML by any chance?
Check it out.
T-SQL
-- DDL and sample data population, start
DECLARE @tbl TABLE (ID INT IDENTITY PRIMARY KEY, col NVARCHAR(MAX));
INSERT INTO @tbl (col) VALUES
(N'<div class="ExternalClassDB075A28F1AB44DA882ED25EFAA3FD94">Take trial testimony & attempt to settle up to 175k</div>'),
(N'<div class="ExternalClass5D1ECD3D7E8E4613B043854E073CD5E9">
<span id="ms-rterangepaste-start">
</span>Continuance is being filed as we have a May 4th trial setting. Authority to settle Joshua Francis up to 240,000<span id="ms-rterangecursor-start">
</span><span id="ms-rterangecursor-end"></span></div>');
-- DDL and sample data population, end
;WITH rs AS
(
SELECT *
, colXML = TRY_CAST(col AS XML)
FROM @tbl
)
SELECT rs.ID
, c.value('(./text())[1]','VARCHAR(100)') AS colText
FROM rs CROSS APPLY colXML.nodes('/div') AS t(c);
Output
ID colText
1 Take trial testimony & attempt to settle up to 175k
2 Continuance is being filed as we have a May 4th trial setting. Authority to settle Joshua Francis up