Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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], 
       [LeafeName], 
       [TimeLastModified] 
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
add comment

1 Answer

NEVER READ DIRECTLY FROM THE DATABASES
(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
1  
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
1  
I will point you to two blogs where they show you how to configure this service: blogs.msdn.com/b/ecm/archive/2010/05/03/… and codeproject.com/Articles/70865/SharePoint-2010-Logging-Database –  Hossein Aarabi Oct 31 '12 at 20:35
1  
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
show 1 more comment

Your Answer

 
discard

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.