title: Creating the temp table to insert the value in the sorting order. It is working fine in SQL Server 2008 but not in SQL Server 2012
body: <p>My exact requirement is: I have an <code>Employee</code> table which is not in ordered way, so I want to order it by NM first of all and insert a new row @ the beginning of the table.</p>
  
  <pre><code>Insert into #temptable(ID, name, place,Address) 
     Select 
         ID, name, place, Address 
     from 
         Employee 
     order by 
         NM 
  
  Select 
      0 as ID,
      'Select Employee' as NM,
      'No place' as place,
      'No address' as Address
  
  Union All
  
  Select 
      w.ID, w.NM, w.Place, w.Address 
  from 
      #temptable w
  </code></pre>
  
  <p>I want the second part of union query to be ordered by NM.
  The above appproach is not giving me the result in order</p>
  
  <p>Suggest me any alternative way of doing this, since this not not working in SQL Server 2012</p>