Solved

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

Posted on 2014-11-20
3
911 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
t-sql Joining Issue 10 40
Query Syntax 17 36
Inserting oldest record into new table. 5 25
Update a text value in another table 10 40
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

809 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