title: Loop through SQL Table valued parameter
body: <p>I'm trying to achieve a advanced search functionality for my application in which i have a <code>SQL</code> Table Valued Parameter in the following structure,</p>
  
  <pre><code>ColumnName   Operator       Keyword
  ------------------------------------
  Name          StartsWith     Ram
  City          Equals         Chennai
  </code></pre>
  
  <p>My <code>SQL</code> table,</p>
  
  <pre><code>Name         City      CreatedDate
  -----------------------------------
  Ram          Chennai   10/10/2014
  Ramachan     Kovai     02/03/2015
  </code></pre>
  
  <p>How can i loop thorough this <code>TVP</code> so that i can build the <code>WHERE</code> clause and can append it to the <code>SELECT</code> query which is faster since i have some 10 rows of search values(criteria).</p>
  
  <p>The filters are associated with <code>AND</code> operator.</p>
  
  <p>List of operators used:</p>
  
  <ol>
  <li>Equals</li>
  <li>Not equals</li>
  <li>Starts with</li>
  <li>Ends with</li>
  <li>From(Date)</li>
  <li>To(Date)</li>
  </ol>