SELECT [RuleSetID]

,[ParentID]
,s.[ConstID]
,[fDeletedInAD]
,[fDeletedHere]
,[fDeleted]
,s.[ProjectID]
,c.NamePart ‘Board Name’
,b.ExtensionId
FROM [Tfs_DefaultCollection].[dbo].[Sets] s
JOIN tfs_DefaultCollection.dbo.constants c
ON c.constid = parentid
JOIN tfs_DefaultCollection.dbo.tbl_Board b
ON b.TeamId = c.TeamFoundationId
WHERE s.ConstID = (SELECT constid from tfs_DefaultCollection.dbo.constants where string = @UserId)
AND b.CategoryReferenceName = ‘Microsoft.RequirementCategory’
AND c.DomainPart = @ProjectGUID
AND c.NamePart <> @ProjectName + ‘ Team’
ORDER BY [Board Name]

Advertisements