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
 SQL Server Development (2000)
 Last modified date

Author  Topic 

iminore
Posting Yak Master

141 Posts

Posted - 2007-04-12 : 08:19:40
Does anyone have a method of storing a 'last modified date/time' on a record that does not use triggers.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-04-12 : 08:22:34
Do it in your codes or stored procedure. Set the "last modified" column to getdate() whenever you update the record(s).




KH

Go to Top of Page

iminore
Posting Yak Master

141 Posts

Posted - 2007-04-12 : 08:26:04
I should have stated I want the date/time to be updated regardless of how the record is updated. That's the beauty of a trigger.
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-04-12 : 08:28:52
Then you have to go for triggers


KH

Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-04-12 : 08:57:13
Do you need the Date Time of modification, or just an indication that it has changed?

If the second then a column with a ROWVERSION (formerly TIMESTAMP which is now deprecated) datatype would do. SQL Server will guarantee to change the value of that whenever a row is saved, without having to have Triggers. That would, for example, allow you to compare the data in one database/table with another to enable you to "freshen" the second with any changes [i.e. rows where the ROWVERSION column was different]

Kristen
Go to Top of Page

iminore
Posting Yak Master

141 Posts

Posted - 2007-04-12 : 09:26:23
I've said it before and I'll say it again - you're a star Kristen.
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-04-12 : 09:30:24
Kristen
you can read mind ?


KH

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-04-12 : 10:46:16
quote:
Originally posted by khtan

Kristen
you can read mind ?


KH




Yes. Mostly

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-04-12 : 17:08:35
Bot .. Bot ... Bot ...
Go to Top of Page
   

- Advertisement -