Aeries Schoology Queries / Coding

Type: Education
Aeries Version: 8.17.8.2 (Verified working)
SQL Server: 2012 (Verified working)
Posted: 2017.09.19

Getting data from Aeries to Schoology isn't super difficult, but when it is already done, why do it again?
Here are the queries I created and used to populate Schoology with data from Aeries.

Users

select tch.tf as 'First_Name',tch.te as 'Last_Name',
tch.em as 'Username','Teacher' as 'Role','YOURSCHOOL' as 'Building',
tch.em as 'Email',tch.tn as 'User Unique ID' from tch
join ( select distinct tn from mst where sc = 2 ) as mst on tch.tn = mst.tn
where tch.sc = 2 and tch.tn > 0 and tch.em != ''

UNION

select stu.fn as 'First_Name', stu.ln as 'Last_Name',
stu.sem as 'Username','Student' as 'Role','YOURSCHOOL' as 'Building',
stu.sem as 'Email', stu.id as 'User Unique ID' from stu
where stu.sc = 2 and stu.del = 0 and (stu.tg = '' or stu.tg = 'I');

Courses

select crs.co as 'Course_Name',mst.cn as 'Course Code','None' as 'SectionName',
mst.se as 'SectionSchoolCode',mst.sm as 'GradingPeriod','YOURSCHOOL' as 'Building',
mst.pd as 'Period' from mst
inner join crs on 
mst.cn = crs.cn
where mst.sc = 2 and mst.del = 0;

Enrollments

select mst.cn as 'Course Code',mst.se as 'SectionSchoolCode',
mst.tn as 'User Unique ID','Teacher' as 'Role' from mst where mst.sc = 2 and mst.del = 0

UNION

select sec.cn as 'Course Code',sec.se as 'SectionSchoolCode',
stu.id as 'User Unique ID','Student' as 'Role' from sec
inner join stu on
sec.sn = stu.sn
where sec.sc = 2 and sec.del = 0;
Notes
  • SC 2 is normal school (Fall/Spring). If yours is different, make sure to change it. This is the same code you use when connecting to CS.
  • Change 'YOURSCHOOL' to the name of your building in Schoology.