|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Most recent record
How can I query for the most recent record added to a table? Is there a way to relate the most recent record to CREATE TRIGGER ON INSERT?
|
|
#2
|
|||
|
|||
|
In SQL Server you can do this by using IDENTITY property of the column
create table example(eid numeric(10,0) identity,ename varchar(10)) insert into example values('manohar') insert into example values('deep') we can get most recent record using following query select * from example where eid =(select max(eid) from example) |
|
#3
|
|||
|
|||
|
Manoher:
Thanks! It's been a few days since I've checked the thread but had come up with the same solution in the meantime. Good to know I was on the right track. Frank |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft SQL Server > Most recent record |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|