You can't retrieve data based on the transactions. You could retrieve the row_number(), but this would only tell you the records inserted, which is not necessarily the last transactions because one transaction might be an update. With that constraint in mind, the way to do this would be to use something like
select top 2 row_number() over (order by Name desc) as 'RowNum', ...
from tbl_student
group by Name
order by Name desc
Note that I haven't tested this, it's just been entered in the editor so you may have to tweak the syntax a little bit.