Trying to search column Data, its an xml column
[dbo].[HistoryData].[Data].exist('//text()[CONTAINS(., 'Request viewed' )]') = 1
I get error Incorrect syntax near 'Request'. What am i missing here? kindly assist.
Column Data has this:
<MessageNotification xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<AttorneyID xsi:nil="true" />
<MatterID xsi:nil="true" />
<NotificationID xsi:nil="true" />
<MessageId>3566913</MessageId>
<ParentMessageGuid xsi:nil="true" />
<MessageGuid>fc54e518-e45d-4564-8b80-2593796d5b</MessageGuid>
<Subject>Firm not registered </Subject>
<MessageDate>2015-06-19T10:05:48.4493646+02:00</MessageDate><Body>
This is just a message
Thank you
</Body>
<ContactPerson> N/A </ContactPerson><ContactDetails xsi:nil="true" />
<PreferredContactMethod>NotApplicable</PreferredContactMethod>
</MessageNotification>
Request viewedisn't encapsulated in the string, you end the string and typeRequest viewedthen start the string again. so it is treatingRequest viewedas something meaningful