Tuesday, 22 May 2012

How to query the TFS 2010 Source control database (TFSWarehouse) using TSQL

Found this blog useful today, when a colleague of mine asked how he can produce a report of all the changes from members of his team on their database scripts in TFS source control...

http://stackoverflow.com/questions/834107/tfs-query-in-visual-studio-to-get-all-check-ins

Something like this example was what we ended up using ...

USE [Tfs_DefaultCollection]  

SELECT distinct cs.CreationDate, cs.[ChangeSetId], c.DisplayPart, cs.[Comment] , v.[FullPath]
from [tbl_ChangeSet] AS cs
left outer JOIN [tbl_Identity] AS i ON cs.[OwnerId] = i.[IdentityId]
left outer JOIN [Constants] AS c ON i.[TeamFoundationId] = c.[TeamFoundationId]
left outer join dbo.tbl_Version as v on v.Versionfrom = cs.ChangeSetId
WHERE creationdate > '04/12/2012'
and (v.FullPath like '%\Database%')
ORDER BY cs.[CreationDate] desc

No comments:

Post a Comment

How to by pass the Jaguary X-Type enter security pin screen after changing battery

How to bypass security code on Jaguar X-Type touchscreen Satellite Navigational units. Just hold the skip track, AMEM and PTY buttons ...