title: Loop a table valued function sql
body: <p>I have a table valued function which returns the boss of a person for a given day.</p>
  
  <blockquote>
    <p>dbo.Bosses(@empId, @date)</p>
  </blockquote>
  
  <p>How do I loop through this function with information from another?</p>
  
  <p>I.e, I want to use Table B that has a date and employee Id and I want to use them as arguments to find all the bosses for each day inputted in Table B</p>
  
  <pre>
  Table B
  EmpId     int
  hours     float
  day       datetime
  creator   int
  </pre>