SharePoint 2007 - SQL查询以查找网站集中的文档列表

Pap*_*iel 4 sql sharepoint

我需要获取网站集中所有文档的列表,我相信我可以使用alldocs表或alluserdata表(MOSS 2007 SP1),但是看不到我如何获取文档的作者信息.我不需要文档的内容(例如AllDocStreams内容)

像这样的东西:

SELECT     tp_DirName, tp_LeafName, tp_Version, tp_Modified, tp_Created
FROM         AllUserData
WHERE     (tp_ContentType = 'Document') 
AND (tp_LeafName NOT LIKE '%.css') 
AND (tp_LeafName NOT LIKE '%.jpg') 
AND (tp_LeafName NOT LIKE '%.png') 
AND (tp_LeafName NOT LIKE '%.wmf') 
AND (tp_LeafName NOT LIKE '%.gif') 
AND (tp_DirName NOT LIKE '%Template%') 
AND (tp_IsCurrentVersion = 1) 
AND (tp_LeafName NOT LIKE '%.xsl')
ORDER BY tp_SiteId, tp_ListId, tp_DirName, tp_LeafName, tp_IsCurrentVersion DESC
Run Code Online (Sandbox Code Playgroud)

有没有更好的方法来解决这个问题?

小智 5

声称无法查询SharePoint数据库的人因为不受支持而导致错误.从阅读文档,只要您使用'With(NoLock)'子句,就可以查询数据库.显然不支持更新,删除或插入记录.

支持以下查询:

Select * 
From your_content_database.dbo.AllDocs With (NoLock)
Run Code Online (Sandbox Code Playgroud)

我将在几分钟内发布一个提供所需结果的查询.