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 find the last interactive logons in Windows using PowerShell

Use the following powershell script to find the last users to login to a box since a given date, in this case the 21st April 2022 at 12pm un...