0

I'm trying to write a query for the TFS 2010 database that will return all of yesterday's checkins ordered by Team Project. So far I have:

USE [Tfs_DefaultCollection]
SELECT ChangeSetId, CreationDate, Comment, CommitterId 
  FROM tbl_ChangeSet 
  WHERE CreationDate > DATEADD([day], -2, GETDATE()) /*not perfect*/
    AND CreationDate < GETDATE();

I'm not sure how to map CommitterId to an actual user name, and I'm not really even sure where to begin in getting the name of the Team Project in which the checkin occurred. Any thoughts?

Chris
  • 1,231
  • 1
  • 17
  • 35

1 Answers1

2

You are querying the operational datastore of TFS. This is not supported and a bad practice. Instead please use the TfsWarehouse which has a much better aggregated model of querying your data.

Ewald Hofman
  • 12,688
  • 3
  • 39
  • 44
  • The database is empty. I found your instructions for refreshing the Warehouse manually, but when I press Invoke, I receive an HTTP 500 error. – Chris Sep 22 '11 at 16:56
  • 1
    Grant Holliday has an excellent blog post to dive deeper in the reasons why the job fails: http://blogs.msdn.com/b/granth/archive/2010/07/12/monitoring-the-tfs-data-warehouse-faq.aspx – Ewald Hofman Sep 23 '11 at 12:41