Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
  Query for reteriving the last updated record.

Author  Topic 

sadiq
Starting Member

1 Post

Posted - 2004-11-09 : 04:26:17
Dear Friend,

Can you tell me the query for reteriving the last updated record. Is there a way to do it.

Thank you.

Kristen
Test

22859 Posts

Posted - 2004-11-09 : 04:54:29
Probably only if you have a "Change Date" column in your table, which is updated whenever a record is saved.

Kristen
Go to Top of Page

B0g
Starting Member

19 Posts

Posted - 2004-11-09 : 05:19:29
As I know there is not such thing. However you can add a field datetime field and update it with GETDATE() for every updated record.
The rest is simple => SELECT * FROM Table ORDER BY LastUpdate DESC
Go to Top of Page

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2004-11-09 : 07:23:40
We have a trigger that records some of the data that was updated in a seperate table along with a datetime stamp for the update


steve

To alcohol ! The cause of - and solution to - all of life's problems
Go to Top of Page
   

- Advertisement -