I have the following query:
SELECT
CAST([Action] AS NVARCHAR(4000)) AS CastAction,
CHARINDEX(CAST([Action] AS NVARCHAR(4000)), N'StatusChange') AS FoundIndex
FROM AuditTrail
WHERE action LIKE '%StatusChange%'
The action is an NTEXT field - this query returns many rows that correspond to the StatusChange in the text of the action, but the charindex returned is always zero. Any ideas. Do I need to break this line to sort some data?
Paddy source
share