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.
| 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 |
 |
|
|
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. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-04-12 : 08:28:52
|
Then you have to go for triggers KH |
 |
|
|
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 |
 |
|
|
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. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-04-12 : 09:30:24
|
Kristenyou can read mind ? KH |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-04-12 : 10:46:16
|
quote: Originally posted by khtan Kristenyou can read mind ? KH
Yes. Mostly MadhivananFailing to plan is Planning to fail |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-04-12 : 17:08:35
|
Bot .. Bot ... Bot ... |
 |
|
|
|
|
|