Click here to Skip to main content
15,921,113 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
HI all,


is it possible to get latest inserted record from the table in sql server,
that table dont have identity column and created date column

please help me





Thanks & Regards
Sudheer.N
Posted
Comments
Sandeep Mewara 1-Jun-12 5:18am    
You need to provide more scenarios & possible ways data can be inserted and accessed. Multi-user scenario?

Hi, since there is no code presents your solution details here, So I will direct you to a similar discussion : http://stackoverflow.com/questions/5228780/how-to-get-last-inserted-id[^].

Good Luck.
 
Share this answer
 
"slect max(your record)coloumn name from yourTableName"
After ur insert query
 
Share this answer
 
v2
use inserted trigger in table which will return the last inserted record.
 
Share this answer
 
Comments
Sandeep Mewara 1-Jun-12 5:17am    
Will work, but what if the last record was inserted by someone else a day back?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900