title: Formatting multiple phone numbers with Parenthesis[ () ] and hyphen( - ) in SQL Server
body: <p>I have a result set in SQL and which contains set of phone numbers with comma separated, earlier we had only one phone number and I could able to format the phone numbers I need i.e.</p>
  
  <pre><code>(123)456-7890
  </code></pre>
  
  <p>Now this formula doesn't work since I have more than 10 digits in my SQL column, so is there any way I can achieve this transaction in <code>SQL</code>? Here is my SQL output.
  <a href="https://i.stack.imgur.com/pxNHr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pxNHr.png" alt="enter image description here"></a></p>
  
  <p>Btw I am getting this <code>comma separated</code> value from this code.</p>
  
  <pre><code>SELECT
  EmployeeID,
  Type,
  STUFF(
      (
      SELECT
          ', ' + PhoneNumber
      FROM EmpPhone E
      WHERE E.EmployeeID = T.EmployeeID AND E.Type = T.Type
      FOR XML PATH(''),TYPE
      ).value('.','VARCHAR(MAX)'
      ), 1, 1, ''
  ) AS Phones
  INTO #PhoneNumbers
      FROM EmpPhone AS T
      GROUP BY EmployeeID, Type
  </code></pre>
  
  <p>so my question is can the query result be made like </p>
  
  <pre><code>(919)382-9999,(888)888-8888,(222)-2222 ......
  </code></pre>