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
 Old Forums
 CLOSED - General SQL Server
 how to find the last time a database was modified

Author  Topic 

mmssi
Starting Member

5 Posts

Posted - 2005-01-28 : 16:00:22
how can i find the last time a database in sql was modified or written records to.

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2005-01-28 : 19:24:45
You would need to have the database in full recovery mode; and you would need to use a tool like Lumigent Log Explorer. If this is something you need ongoing, you could use a tool like Profiler; however, it would be extremely hard on the server to track every transaction. The best thing to do is design the database to properly track when modifications happen in the first place.

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-08-02 : 05:52:08
[code]SELECT so.name ObjectName,
so.type ObjectType,
max(convert(datetime, l.[Begin Time])) LogTime
FROM ::fn_dblog (DEFAULT, DEFAULT) l
inner join sysobjects so on so.name = l.[transaction name]
--where so.type = 'u'
group by so.name,
so.type
order by so.name,
so.type[/code]


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-08-02 : 05:56:37
nice one peso.



Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-08-21 : 00:33:05
Peso, can you highlight the change you made?

Madhivanan

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

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-08-21 : 00:42:16
Have I done any change?

Peter Larsson
Helsingborg, Sweden
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-08-21 : 01:18:53
It seems. Didnt you edit your reply on 2006-08-18?

Madhivanan

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

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-08-21 : 02:15:43
The only thing that come into mind, could be the spacing between my signature and the code itself.
I sometimes go back and edit my messages, but that is most often due to spelling mistakes.
If I change in the code, I mark that with a color and write a note about it, or simply repost.

Or simply I didn't remember to check "Subscribe" checkbox?


Peter Larsson
Helsingborg, Sweden

EDIT: Last sentence with remember.
Go to Top of Page
   

- Advertisement -