SELECT     dbo.Teacher.personID as district_user_id, 'sect' + cast(dbo.Teacher.sectionID as varchar) as district_group_id,
null  as principal
FROM         dbo.Teacher INNER JOIN
                      dbo.Trial ON dbo.Teacher.trialID = dbo.Trial.trialID  INNER JOIN
                      dbo.Calendar ON dbo.Trial.calendarID = dbo.Calendar.calendarID INNER JOIN
                      dbo.SchoolYear ON dbo.Calendar.endYear = dbo.SchoolYear.endYear AND dbo.SchoolYear.active = 1 INNER JOIN
                      dbo.Section ON dbo.Teacher.sectionID = dbo.Section.sectionID INNER JOIN
                      dbo.Course ON dbo.Course.courseID = dbo.Section.courseID AND dbo.Course.active = 1
where dbo.trial.active=1



