SharePoint: Výpis všech workflow v chybovém stavu přes celou obsahovou databázi

SELECT         dbo.WorkflowAssociation.Id AS AssociationID, dbo.Workflow.InternalState, dbo.Workflow.Status1, dbo.Workflow.Created AS Started, dbo.Workflow.TemplateId, dbo.Lists.tp_Title AS ListTitle, dbo.AllUserData.nvarchar1 as ItemTitle,
                          dbo.Webs.Title AS WebTitle, dbo.Webs.FullUrl AS WebUrl, dbo.Workflow.SiteId, dbo.Workflow.WebId, dbo.Workflow.ListId, dbo.Workflow.ItemId, 
                         dbo.Workflow.ItemGUID, dbo.AllUserData.tp_GUID
FROM            dbo.AllUserData RIGHT OUTER JOIN
                         dbo.Workflow ON dbo.AllUserData.tp_GUID = dbo.Workflow.ItemGUID LEFT OUTER JOIN
                         dbo.Sites RIGHT OUTER JOIN
                         dbo.WorkflowAssociation ON dbo.Sites.Id = dbo.WorkflowAssociation.SiteId LEFT OUTER JOIN
                         dbo.Webs ON dbo.WorkflowAssociation.WebId = dbo.Webs.Id LEFT OUTER JOIN
                         dbo.Lists ON dbo.WorkflowAssociation.ListId = dbo.Lists.tp_ID ON dbo.Workflow.TemplateId = dbo.WorkflowAssociation.Id
WHERE        (dbo.Workflow.Status1 = 1 OR
                         dbo.Workflow.Status1 = 3 OR
                         dbo.Workflow.Status1 = 6 OR
                         dbo.Workflow.Status1 = 7) AND (dbo.Workflow.ItemId > 0)
ORDER BY Started

 

Napsat komentář

Tato stránka používá Akismet k omezení spamu. Podívejte se, jak vaše data z komentářů zpracováváme..