title: Relation between build definition and build agent in Team Foundation Server
body: <p>I am working on a report which has 3 columns as follows</p>
  
  <ol>
  <li>Controller</li>
  <li>BuildAgents under controller</li>
  <li>BuildDefinitions running on this specific agent.</li>
  </ol>
  
  <p>Each controller has two or more build agents.The build definition can run on one or all agents of the controller. 
  Currently the build definition table in TFS warehouse is joined to build controller table on controller id so all the definitions running on controller are reflected for all agents under controller.
  I would like to know the proper join between agent id and definition id so that only respective build definitions running on agents are displayed.</p>
  
  <p>Thanks! </p>