Click here to Skip to main content
15,896,153 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Hi
How to find last update records in table, is possible to check it dataset?
Posted
Comments
Sergey Alexandrovich Kryukov 23-Oct-12 0:46am    
This is not how a relationship RDBMS "automatically" work. You need to develop special database schema to record "history" and provide some interface which does not allow to bypass it and update other data without updating the "history" part of data. So, this is the skeleton of such work. Care to try?
--SA
MT_ 23-Oct-12 2:45am    
Does the solution below works/worked?

1 solution

Hi
As SA suggested, there is no straightforward way. What you can do is to add a column in the table like "LastUpdated" and define datatype as TimeStamp. This will then update it whenever you edit/insert a record.
Then you can easily find the last updated row/rows.

http://msdn.microsoft.com/en-us/library/aa260631(v=sql.80).aspx[^]

Other way could be a query as shown below
SQL
SELECT IDENT_CURRENT('TableName')


Where tablename is actual table name. This wil give you id (primary key) of the last updated row.

Hope that helps.

Thanks
Milind
 
Share this answer
 
v2

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