title: Searching XML column in sql server
body: <p>Trying to search column Data, its an xml column</p>
  
  <pre><code>[dbo].[HistoryData].[Data].exist('//text()[CONTAINS(., 'Request viewed' )]') = 1
  </code></pre>
  
  <p>I get error Incorrect syntax near 'Request'. What am i missing here? kindly assist.</p>
  
  <p>Column Data has this:</p>
  
  <pre><code>&lt;MessageNotification xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
  &lt;AttorneyID xsi:nil="true" /&gt;
  &lt;MatterID xsi:nil="true" /&gt;
  &lt;NotificationID xsi:nil="true" /&gt;
  &lt;MessageId&gt;3566913&lt;/MessageId&gt;
  &lt;ParentMessageGuid xsi:nil="true" /&gt;
  &lt;MessageGuid&gt;fc54e518-e45d-4564-8b80-2593796d5b&lt;/MessageGuid&gt;
  &lt;Subject&gt;Firm not registered &lt;/Subject&gt;
  &lt;MessageDate&gt;2015-06-19T10:05:48.4493646+02:00&lt;/MessageDate&gt;&lt;Body&gt;
  
  This is just a message
  
  Thank you
  
  &lt;/Body&gt;
  &lt;ContactPerson&gt; N/A &lt;/ContactPerson&gt;&lt;ContactDetails xsi:nil="true" /&gt;
  &lt;PreferredContactMethod&gt;NotApplicable&lt;/PreferredContactMethod&gt;
  &lt;/MessageNotification&gt;
  </code></pre>