title: SQL query ; horizontal to vertical
body: <p>I'm stuck with a SQL query (SQL Server) that involves converting horizontal rows to vertical rows</p>
  
  <p>Below is my data</p>
  
  <pre><code>No      Flag_1    Flag_2    Flag_3
  ---      ----      -----     -----
  A         1         2         3
  B         4         1         6
  </code></pre>
  
  <p>After conversion , the table should be </p>
  
  <pre><code>No     FlagsName    Flag_value
  --      ----        ----------
  A        Flag_1        1
  A        Flag_2        2  
  A        Flag_3        3
  B        Flag_1        4
  B        Flag_2        1
  B        Flag_3        6
  </code></pre>
  
  <p>Any input on this would be helpful?</p>
  
  <p>I'm trying to play around <code>ROW_NUMBER</code> over partition. but it is not working somehow !!!</p>
  
  <p>Thanks !!!</p>