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)
 Table modification Date Time

Author  Topic 

mk_garg20
Constraint Violating Yak Guru

343 Posts

Posted - 2004-08-27 : 00:51:08
Hi All,
How can i get Date and Time when last time table was modified.

Thanks

mk_garg

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2004-08-27 : 01:03:54
do you mean the last time data was inserted/updated/deleted or do you mean the last time the table definition changed? (added column, etc.)



-ec

Go to Top of Page

mk_garg20
Constraint Violating Yak Guru

343 Posts

Posted - 2004-08-27 : 01:13:22
Last time data inserted/updated/deleted
Thanks

mk_garg
Go to Top of Page

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2004-08-27 : 01:26:57
create a trigger, and update a summary table with that info. There is no other way that I know of.



-ec
Go to Top of Page

mk_garg20
Constraint Violating Yak Guru

343 Posts

Posted - 2004-08-27 : 01:30:25
Thanks for that

mk_garg
Go to Top of Page

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2004-08-27 : 01:34:12
to elaborate a little bit more, I have a database where we have a requirement to track these types of changes.

Our trigger grabs the username who made the change, the datetime and the before/after values (on an update). I think we also grab hostname or IP address, I'll have to look. ALso, we never perform an actual delete, we just mark a record inactive.



-ec
Go to Top of Page

mk_garg20
Constraint Violating Yak Guru

343 Posts

Posted - 2004-08-27 : 01:44:45
Thanks ec

mk_garg
Go to Top of Page
   

- Advertisement -