How to get a row was inserted most recently in a table?

 Posted by Syedshakeer on 9/8/2009 | Category: Sql Server Interview questions | Views: 6947
Answer:

select top 1 * from tablename order by ColumnName desc


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Pandians on: 9/8/2009
Hi

Pl specify the ColumnName you used (Is it InsetedDate/Identity Value / Something else ?).
So that It will be useful to others .

Cheers

Posted by: Kapil.j.dhokai on: 9/21/2009
get a row was inserted most recently in a table

select top * 1 from table_name order by 1 desc

Login to post response