title: The argument 1 of the XML data type method "query" must be a string literal
body: <p>I have data in xml format in SQL Server. Now I am trying to find out single record based on my query. I am putting my code below,</p>
  
  <pre class="lang-sql prettyprint-override"><code>declare @xml xml
  declare @ID varchar
  set @ID = '1'
  set @xml = '
  &lt;row&gt;
      &lt;Id&gt;1&lt;/Id&gt;
      &lt;name&gt;OM&lt;/name&gt;
  &lt;/row&gt;
  &lt;row&gt;
      &lt;Id&gt;2&lt;/Id&gt;
      &lt;name&gt;JAI&lt;/name&gt;
  &lt;/row&gt;
  &lt;row&gt;
      &lt;Id&gt;2&lt;/Id&gt;
      &lt;name&gt;JAGDISH&lt;/name&gt;
  &lt;/row&gt;
  '
  </code></pre>
  
  <p>When I am executing my query, then it gives me a proper result (xml node): </p>
  
  <pre><code>Select @xml.query('/row[Id="1"]');
  </code></pre>
  
  <p>But When I am concatenating @ID to query, then it gives me an error: </p>
  
  <pre><code>Select @xml.query('/row[Id='+ @ID +']');
  </code></pre>
  
  <p>The error is:</p>
  
  <blockquote>
    <p>The argument 1 of the XML data type method "query" must be a string literal. </p>
  </blockquote>