Sunday, September 18, 2011

TFS–determining the build in which a particular changeset was delivered in

If you ever need to determine in which build a particular changeset was delivered in, here is the query that you can run against the TFS_Warehouse database:

SELECT     c.ChangesetTitle, c.ChangesetID, b.BuildID, b.BuildName, b.BuildDefinitionName, b.LastUpdatedDateTime
FROM         FactBuildChangeset AS bc INNER JOIN
                      DimTeamProject AS tp ON tp.ProjectNodeSK = bc.TeamProjectSK INNER JOIN
                      DimBuild AS b ON b.BuildSK = bc.BuildSK INNER JOIN
                      DimChangeset AS c ON c.ChangesetSK = bc.ChangesetSK INNER JOIN
                      DimPerson AS p ON p.PersonSK = c.CheckedInBySK
WHERE    
(tp.ProjectNodeName = 'ProjectName')
AND (p.Name = 'PersonCheckedInByName')
AND (b.BuildDefinitionName = 'BuildDefinitionName')

image

Reference:
http://msdn.microsoft.com/en-us/library/ee620641.aspx (Build Changeset Tables)

No comments: