Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1277
  • Last Modified:

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

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
rye004
Asked:
rye004
  • 2
1 Solution
 
RayCommented:
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
 
rye004Author Commented:
Ckchan,

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

I am using SharePoint 2010 RTM.

Kind Regards,

Ryan
0
 
rye004Author Commented:
This worked perfectly.  Thank you.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now