title: Check whether one of the attributes contains given value or not
body: <p>I am using SQL Server 2012. I have the following code</p>
  
  <pre><code>    DECLARE @p varchar(4)
      SET @p = ext1
  
      DECLARE @x xml
      SET @x = '&lt;labels defaultText = "Some text 2012"&gt;      
                  &lt;label text = "Some text1" /&gt;      
                  &lt;label text = "Some text2" /&gt;      
                  &lt;label text = "Some text3" /&gt;
                &lt;/labels&gt;'
  </code></pre>
  
  <p>Please, help to write an xpath/xquery query to check whether defaultText value or one of the texts' values contain @p or not. In this example the result will be true , because value of the text in the first label contains ext1. </p>