Get Web Part By GUID

Can't take credit, found this one.  I just want to make sure I can find this again. :)

SELECT WebParts.tp_SiteId, WebParts.tp_ID, WebParts.tp_ListId, WebParts
.tp_Type, WebParts.tp_Flags, WebParts.tp_BaseViewID, WebParts
.tp_DisplayName, WebParts.tp_Version, WebParts.tp_PageUrlID, WebParts
.tp_PartOrder, WebParts.tp_ZoneID, WebParts.tp_IsIncluded, WebParts
.tp_FrameState, WebParts.tp_View, WebParts.tp_WebPartTypeId, WebParts
.tp_AllUsersProperties, WebParts.tp_PerUserProperties, WebParts
.tp_Cache, WebParts.tp_UserID, WebParts.tp_Source, WebParts
.tp_CreationTime, WebParts.tp_Size, WebParts.tp_Level, WebParts
.tp_Deleted, WebParts.tp_HasFGP, WebParts.tp_ContentTypeId, AllDocs
.DirName, AllDocs.LeafName FROM WebParts INNER JOIN AllDocs
ON WebParts.tp_PageUrlID = AllDocs.Id
WHERE (WebParts.tp_WebPartTypeId = '<Web Part GUID>'

Comments

Popular posts from this blog

Metastorm - Open form in an action from a list or link

Corporate Intranet Information Architecture – a Publishing Site

No Search Results in SharePoint Contextual Search OSSSearchResults.aspx