title: TSQL: Replace same field multiple times in one query
body: <p>Given a table of replacements, can all the replacements be applied to a column in a table in the same query?</p>
  
  <p>Disclaimer: I can do this with a cursor, or with dynamic sql to create a nested string of replacements; I want to know if it could be done concisely.</p>
  
  <p>I have a replacements table, </p>
  
  <pre><code>create table #replacements(old varchar(max), new varchar(max))
  insert into #replacements values
  ('X','Y'),
  ('A','B'),
  ('W','V'),
  ('C','D')
  </code></pre>
  
  <p>and a table of values to replace:</p>
  
  <pre><code>create table #value(value varchar(max))
  insert into #value values
  ('XA'),
  ('WC')
  </code></pre>
  
  <p>I'd like to perform these in one query which gives back:</p>
  
  <p>YB</p>
  
  <p>VD</p>
  
  <p>Is there any way to do this? I tried, </p>
  
  <pre><code>update v
  set value = replace(value,old,new)
  from #value v,
  #replacements
  </code></pre>
  
  <p>but this gives (only the first row in the full join is done):</p>
  
  <p>YA</p>
  
  <p>WC</p>