How to get last updated column in sql

Posted by Oswaldlily under Sql Server on 2/8/2013 | Points: 10 | Views : 1324 | Status : [Member] | Replies : 1
I need last updated row..In that i require oly last updated column values..Is it possible to get??




Responses

Posted by: Murugavelmsc on: 2/9/2013 [Member] Starter | Points: 25

Up
0
Down
The table which is having Identity Property from that table we can get the last inserted record id will be like this


SELECT @@IDENTITY
SELECT SCOPE_IDENTITY()
SELECT IDENT_CURRENT('TableName')

Another way we can get it in

SELECT MAX(EmpId) FROM EmployeeDetails


Other way

SELECT TOP 1 EmpId FROM EmployeeDetails ORDER BY EmpId DESC

Regards,
Murugavel S
murugavel.sadagopan@gmail.com
http://murugavelmsc.blogspot.in/

Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response