SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running SharePoint 2010 and SQL Server 2008 R2.

It's hugely important that I create a list of every file within a given content database that has been modified today, 10/31. Will this query do it or will it leave anything -anything at all- out?

SELECT [DirName], 
FROM   [WSS_Content_TARGETDB].[dbo].[AllDocs] 
WHERE  [TimeLastModified] BETWEEN '20121031' AND '20121101';

I'm crossing my fingers that this will list everything without any gaps.

share|improve this question

(unless there is no other option)

This will probably work with the current patches it might, but it's not documented or guaranteed and even thought it might work now it might stop working if a patch is applied.

Have you consider using the change log which is meant exactly for getting things like this?
See Using the Change Log

share|improve this answer
This isn't meant to be an ongoing solution for something, I just need to create a comprehensive list of files that were modified on 10/31/2012. I'll use any method that will give me a complete list. – newuser Oct 31 '12 at 20:06
If you have configured the Usage and Health Data collection in Central Administration Web site, you can use the Web Analytics reports to get the insight you are looking for, plus more. – Hossein Aarabi Oct 31 '12 at 20:32
@HosseinAarabi - Can you go into greater detail on that, please? – newuser Oct 31 '12 at 20:33
I will point you to two blogs where they show you how to configure this service:… and – Hossein Aarabi Oct 31 '12 at 20:35
Also, the Usage database is the only SharePoint database that is OK for you to read against. As Per Jakobsen mentioned, you should never directly access or modify any other SP database. – Hossein Aarabi Oct 31 '12 at 20:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.