title: How can I make a REPLACE PATTERN in SQL?
body: <p>I have a long NVARCHAR variable where I need to replace some pattern like this:</p>
  
  <pre><code>DECLARE @data NVARCHAR(200) = 'Hello [PAT1] stackoverflow [PAT2] world [PAT3]'
  </code></pre>
  
  <p>I need to replace all <code>[PAT%]</code> with a blank space to look like:</p>
  
  <pre><code>'Hello stackoverflow world'
  </code></pre>
  
  <p>How can I do this using T-SQL in SQL Server 2008?</p>
  
  <p>I was searching in other questions, and I only found <a href="https://stackoverflow.com/questions/4385649/how-do-i-replace-a-pattern-using-t-sql">this</a>, but it doesn't help me, because I don't need to preserve de original part of the string.</p>