title: How do I search for a string from table column in SQL Server using CHARINDEX function
body: <p>I have a string in table column like below</p>
  
  <pre><code>1. "C-DERD,C-FDER,E-FDFE,E-DFE,C-DFERE"
  2. "E-FDFE,C-DFEC,E-DFDFE,E-DE"
  </code></pre>
  
  <p>If I search for a string like "DE" then it will first check all the individual string that starts with 'C-' AS LIKE CONSTRAINT IN TABLE. If it is found, then it will return TRUE in separate column, in second case it is not found in 'C-' case then it will check in all individual string that start with 'E-' but it is same as searched string. With use of <code>CHARINDEX</code> function only.</p>