Rediscovering the Obvious

…stumbling in the footsteps of greatness

TFS Sql script – list policy overrides

without comments

I don’t like to call out individual blame, but sometimes a bit o’ shame is what it takes… this query, when run against the (2008 version) version control database in TFS will give you a nice summary and detail pair that can be dropped into excel, or whatever.

 

select
    i.DisplayName Person,
    COUNT( po.changesetid ) Violations
from tbl_policyOverride po
    JOIN tbl_changeset cs ON cs.ChangeSetId = po.ChangeSetId
    JOIN tbl_identity i on i.identityId = cs.committerId
Where
    cs.CreationDate > ’11/1/2007′
GROUP BY
    i.displayName
ORDER BY
    Violations DESC

select
    i.DisplayName,
    po.changesetid,   
    po.comment,
    cs.CreationDate
from tbl_policyOverride po
    JOIN tbl_changeset cs ON cs.ChangeSetId = po.ChangeSetId
    JOIN tbl_identity i on i.identityId = cs.committerId
Where
    cs.CreationDate > ’11/1/2007′
order by
    i.displayName,
    po.ChangesetId DESC

 

Written by erwilleke

December 7th, 2007 at 10:40 am

Posted in Uncategorized

Leave a Reply