Solved

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

Posted on 2014-11-20
3
810 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
Comment Utility
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
Comment Utility
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
Comment Utility
This worked perfectly.  Thank you.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.‚Äč
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.
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 the fundamental information of how to create a table.

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now