title: SQL Server : Create Timetable
body: <p>I have a table that records the start and end of a day schedule:</p>
  
  <pre><code>ScheduleID  VenueID Date        StartTime EndTime
      1          1    14/07/2013   10:30     16:30
      2          1    15/07/2013   09:30     16:30
      3          2    16/07/2013   09:00     16:00
  </code></pre>
  
  <p>I need to create a table that self populates 30 minute time slots based in the start and end time so it looks something like this:</p>
  
  <pre><code>TimetableID VenueID    Date      Time_Slots  Client1ID    Client2ID
       1        1     14/07/2013     10:30        45           Null
       2        1     14/07/2013     11:00        67           78
       3        1     14/07/2013     11:30        104          Null
       4        1     14/07/2013     12:00        112          56
  </code></pre>
  
  <p>etc </p>
  
  <p>Any help on how I generate the second table so that I can simple add the Client1ID and Clinet2ID would be greatly appreciated.</p>
  
  <p>Thanks</p>