title: Apply a Mask to Format a String in SQL Server Query/View
body: <p>Is there a neat way to apply a mask to a string in a SQL Server query?</p>
  
  <p>I have two tables, one with Phone number stored as varchar with no literals <code>0155567890</code> and a phone type, which has a mask for that phone number type: <code>(##) #### ####</code> </p>
  
  <p>What is the best way to return a string (for a merge Document) so that the query returns the fully formatted phone number:</p>
  
  <pre><code>(01) 5556 7890
  </code></pre>