title: Formatting SQL Server Query Output
body: <p>I like to get the SQL Server query output in the following way. Currently my output is:</p>
  
  <pre><code>Class | Student ID | Student Name
  ------+------------+---------------
  121        S1          Test 1
  121        S2          Test 2
  500        S22         Test a
  500        S23         Test b
  </code></pre>
  
  <p>But I want the data output in the following way -</p>
  
  <pre><code>Class: 121
  --------------------------------
  
  Student ID | Student Name
  -----------+---------------
  S1            Test 1
  S2            Test 2
  
  Class: 500
  --------------------------------
  
  Student ID | Student Name
  -----------+---------------
  S22            Test a
  S23            Test b
  </code></pre>
  
  <p>Could someone help me how can I achieve these?</p>
  
  <p>Thanks</p>