title: MS SQL - For same id , convert row values to column dynamically
body: <p>My first CTE have below output. Check CTE output image   [1]: <a href="https://i.stack.imgur.com/ky0vT.png" rel="nofollow noreferrer">https://i.stack.imgur.com/ky0vT.png</a></p>
  <p>LOG_ID  Type       PROV_NAME         RK
  100001  Physician   DIPCHAND, ANNE    1
  100001  Physician   ALY, SAFWAT       2
  100001  Physician   BARRON, DAVID     3
  100025  Physician   MCVEY, MARK       1
  100025  Physician   GUARIENTO, ALVISE 2</p>
  <p>I need provider name to go in column for same Log ID, but there is <strong>no fix number</strong> of providers name; it can be 1 or more, <strong>dynamic</strong>. So I do not want to limit column up to prov_name_3, it should add automatically based on number of providers.
  I need below output.
  Check expected output image  [1]: <a href="https://i.stack.imgur.com/MBJx9.png" rel="nofollow noreferrer">https://i.stack.imgur.com/MBJx9.png</a>
  LOG_ID  Type        PROV_NAME_1     PROV_NAME_2         PROV_NAME_3
  100001  Physician   DIPCHAND, ANNE  ALY, SAFWAT         BARRON, DAVID
  100025  Physician   MCVEY, MARK     GUARIENTO, ALVISE</p>