title: Sql search and update based on full word
body: <p>I want to find a word in one of my columns and replace it with some custom text. I have the following table:</p>
  
  <pre><code>DECLARE @Table TABLE ( [Names] VARCHAR(100) )
  
  INSERT INTO @Table
  SELECT 'This is test module for testing' UNION
  SELECT 'This is test module for to fork' UNION
  SELECT 'This is test module for testing mod' UNION
  SELECT 'This is testing' UNION
  SELECT 'This is module'
  </code></pre>
  
  <p>I am explaining below what I need exactly: </p>
  
  <p>When a user searches for the text "test" and wants to replace it with "customtext", the following rows should be selected: </p>
  
  <pre><code>This is test module for testing
  This is test module for to fork
  This is test module for testing mod
  </code></pre>
  
  <p>and after replacing the "test" (full word) with "customtext" the updated records should be:</p>
  
  <pre><code>This is customtext module for testing
  This is customtext module for to fork
  This is customtext module for testing mod
  </code></pre>
  
  <p>As you might have noticed <strong>I need search to be done on full word not on partial text</strong> like 'testing' in above case which contains partial text "test" in it.</p>
  
  <p>Another example to explain the same requirement:</p>
  
  <p>When a user searches for "mod" and wants to replace it with "customtext", the following row should be selected: </p>
  
  <pre><code>This is test module for testing mod
  </code></pre>
  
  <p>and after replacement with "customtext" the updated record should be:   </p>
  
  <pre><code>This is test module for testing customtext
  </code></pre>
  
  <p>Since "mod" is full word it is the word which is replaced and not the word "module" which contains partial text "mod" in it.</p>