Query TFS database to fetch last 10 check-in details
sql, sql-server, tfs
Solution
As a workaround how about the below query.. But i think it is returning me the wrong comments.. not sure why.
SELECT top 10
C.ChangeSetId,
V.FullPath,
V.ParentPath,
REPLACE(V.ChildItem,'\','') as [FileName],
C.CreationDate,
I.DisplayName,
C.Comment
FROM tbl_Version(nolock) V
INNER JOIN tbl_File (nolock) F ON V.ItemId = F.ItemId
INNER JOIN tbl_Changeset (nolock) C ON V.VersionTo = C.ChangeSetId
INNER JOIN tbl_Identity (nolock) I ON C.CommitterId = I.IdentityId
where v.ParentPath like '$\' + (select name from [TfsWorkItemTracking].[dbo].[treenodes] where parentid=0 and fdeleted=0 and id=524) + '\%'
order by C.CreationDate desc
Thanks to mark.crockett for posting the above query @ http://social.msdn.microsoft.com/Forums/en-US/tfsreporting/thread/32d2c27e-825b-43bb-b156-36048a3e70cb/
Problem
Is there a way to query TFS database to get the last 10 check-in details The output should be something like ``` File name | Comment | Changed By | Date ---------------------------------------------------------------------------- Test.cs Added new functionality username 01/08/2010 ``` I am aware that the above result set can be obtained using TFS SDK. But I want to know if there is a way to query the TFS database to fetch the above data. Thanks