title: How can I Replace using the sql wildcard '%'?
body: <p>So this is the data I am pulling in from powershell (there's actually more, but it all follows the same pattern):</p>
  
  <pre><code>Name                   : SULESRKMA  1
  Location               : Leisure Services - Technology Services 2
  DriverName             : KONICA MINOLTA mc4695MF PS PPD 3
  Shared                 : False  4
  ShareName              :    5
  JobCountSinceLastReset : 0  6
  </code></pre>
  
  <p>I am trying to remove 'Name                   : ' and 'Location               : ', and so on, but using the REPLACE command  here is part of my sql query:</p>
  
  <pre><code>SELECT * FROM #ReadCmd
  WHERE Result LIKE 'Name   %:%'
  
  INSERT INTO #output(Name)
  SELECT REPLACE(Result, '% %: %', '')
  From #ReadCmd
  WHERE Result LIKE 'Name   %:%'
  SELECT * FROM #output
  </code></pre>
  
  <p>Or for example, here:</p>
  
  <pre><code>IF  OBJECT_ID('tempdb..#fields') != 0
      DROP TABLE #fields
  
  CREATE TABLE #fields (Fields varchar(256))
  INSERT INTO #fields (Fields)
  SELECT REPLACE(Result, ' %: %', '')
  FROM #ReadCmd
  Where Result Like '% %: %'
  </code></pre>
  
  <p>The point is, I'd like to replace the '_________            : ' with nothing, but the REPLACE command reads the sql wild card '%' as an actual percent sign.  Is there another way to accomplish this?</p>
  
  <p>Using <code>Select RIGHT(Result,CHARINDEX(': ',Result) -1)</code> outputs in seperate cells:</p>
  
  <pre><code>            : SULESRKMA
           : PrimoPDF
  oft XPS Document Writer
                : Fax
     : CutePDF Writer
  </code></pre>