title: How do I use SQL Parameter for CONTAINS query in Azure Cosmos DB SQL API?
body: <p>I have the following sql variable:</p>
  
  <pre><code>SELECT * FROM x WHERE  x.Description CONTAINS(@p1)
  </code></pre>
  
  <p>I have configured a SQL Parameter with name @p1 and a valid string i.e. "foo" and added it to the SqlParameterCollection collection variable with the following:</p>
  
  <pre><code>var sqlQuery = new SqlQuerySpec(sql, collection);
  </code></pre>
  
  <p>I then invoke the following query.</p>
  
  <pre><code>var query = _documentClient.CreateDocumentQuery&lt;T&gt;(GetDocumentCollectionUri&lt;T&gt;(graphRequestContext), sqlQuery, options).AsDocumentQuery();
  </code></pre>
  
  <p>I am getting the following error:</p>
  
  <p>Message: Microsoft.Azure.Documents.DocumentClientException : Message: {"errors":[{"severity":"Error","location":{"start":37,"end":45},"code":"SC1001","message":"Syntax error, incorrect syntax near 'CONTAINS'."}]}
  ActivityId: &lt;<strong>Removed for privacy reasons</strong>>, Microsoft.Azure.Documents.Common/2.2.0.0, Windows/10.0.17763 documentdb-netcore-sdk/2.2.2</p>
  
  <p>Per documentation (<a href="https://docs.microsoft.com/en-us/azure/cosmos-db/sql-api-query-reference" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/cosmos-db/sql-api-query-reference</a>), it seems to be looking for a string expression. Thus, I am looking for confirmation on this, if this is in fact the case.</p>