Solved

Can I get the user information from the AllDocs database in SharePoint?

Posted on 2014-11-20
3
961 Views
Last Modified: 2014-11-22
I have a set of SQL SharePoint databases.  I am trying to find a way to get user information for file sin the AllDocs table.  It would be great if I could get the user for the created and last modified.

I am looking to do this with a SQL query.

Any help would be greatly appreciated.
0
Comment
Question by:rye004
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
Ray earned 500 total points
ID: 40456619
For SP 2013, assume your SP database name is WSS_Content.

SELECT  
(SELECT tp_title FROM WSS_Content.dbo.UserInfo where tp_ID = u.tp_author) as Author,
tp_created,
(SELECT tp_title FROM WSS_Content.dbo.UserInfo where tp_ID = u.tp_editor) as Editor,
tp_modified,
DirName as docpath,
leafname as docName
FROM WSS_Content.dbo.AllDocs d, WSS_Content.dbo.AllUserData u
where   d.siteid = u.tp_siteid and d.id = u.tp_docid
--OPTION
--and DirName = 'MySite/Shared Documents' and leafname  = 'MyDoc.xlsx'
0
 

Author Comment

by:rye004
ID: 40456661
Ckchan,

Thank you for your response.  I will try what you sent me shortly.

I am using SharePoint 2010 RTM.

Kind Regards,

Ryan
0
 

Author Closing Comment

by:rye004
ID: 40460095
This worked perfectly.  Thank you.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question