sadiq-187957
Newbie
Points: 2
More actions
November 9, 2004 at 2:27 am
#60435
Dear Friend,
Can you tell me the query for reteriving the last updated record. Is there a way to do it.
Thank you.
Ste_P
SSCarpal Tunnel
Points: 4430
November 9, 2004 at 3:15 am
#529416
Sadiq,
You need to use a trigger with this format:-
CREATE TRIGGER [Name] ON [Table]
AFTER UPDATE
AS
UPDATE [Table / Column]
INSERT INTO [Table] SELECT [* / Column] FROM Deleted d
Have fun
Steve
We need men who can dream of things that never were.
AJ Ahrens
SSC-Insane
Points: 20676
November 9, 2004 at 5:24 am
#529425
Another option is to have a ModifiedDtTm column with the Date/Time of when the records have been modified and then all you would have to do is SELECT [columns here] FROM [YourTable] WHERE ModifiedDtTm =
(SELECT MAX(ModifiedDtTm) FROM [YourTable]
Or some variant thereof
Good Hunting!
AJ Ahrenswebmaster@kritter.net
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply