select 'sect' + cast(section.sectionID as varchar(10)) as district_group_id, dbo.calendar.schoolID as district_school_id, 
'"' +
coalesce (dbo.Course.number,'') + '-' + cast(dbo.Section.number as varchar(10)) + 
' ' +   coalesce(dbo.Course.name,'') + ' ' + coalesce(dbo.Section.teacherDisplay,'') +  +
'"' AS name
from dbo.section
INNER JOIN
                      dbo.Trial ON dbo.section.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.Course ON dbo.Course.courseID = dbo.Section.courseID AND dbo.Course.active = 1
where dbo.trial.active=1

 

					  