Welcome to Manicprogrammer Sign in | Join | Help

Rediscovering the Obvious

An occasional journey through one man's perspectives as he fumbles along in the footsteps of many great men.
TFS Sql script - list policy overrides

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

 

Published Friday, December 07, 2007 9:40 AM by willeke

Comments

No Comments

Anonymous comments are disabled