title: best way to get the last inserted record in sql server
body: <p>Hi all I having a Identity column and a Computed primary key column in my table I need to get the last inserted record immediately after inserting the record in to database, So I have written the following queries can some one tell which is the best one to choose</p>
  
  <pre><code>SELECT
  t.[StudentID]
  FROM
  [tbl_Student] t
  WHERE
  t.ID = IDENT_CURRENT('tbl_Student')
  </code></pre>
  
  <p>The other is using <code>MAX</code> as follows</p>
  
  <pre><code>Select 
  MAX(StudentID) 
  from tbl_Student
  </code></pre>
  
  <p>From the above two queries which is the best one to choose.</p>