Copy all scheduling tables and data from a database currently scheduling students into classes for the next school year into a database scheduling students into classes for the current school year 


In the destination database:


1. Backup affected tables

EXAMPLE:

SELECT * INTO SSS_20240617 FROM SSS
SELECT * INTO SSM_20240617 FROM SSM
SELECT * INTO SMS_20240617 FROM SMS
SELECT * INTO FTF_20240617 FROM FTF
SELECT * INTO FTT_20240617 FROM FTT
SELECT * INTO CCL_20240617 FROM CCL 
SELECT * INTO CCD_20240617 FROM CCD
SQL


2. Delete scheduling tables, specifying school (if applicable)

EXAMPLE:

DELETE SSS WHERE SC = 102
DELETE SSM WHERE SC = 102
DELETE SMS WHERE SC = 102
DELETE FTT WHERE FSQ IN (SELECT SQ FROM FTF WHERE SC = 102)
DELETE FTF WHERE SC = 102
DELETE CCD WHERE CSQ IN (SELECT SQ FROM CCL WHERE SC = 102)
DELETE CCL WHERE SC = 102
SQL


3. Insert Scheduling Master Schedule records from source database

EXAMPLE:

INSERT SMS (SC, SE, PD, BL, SM, DY, CN, TN, RM, CR, SX, LO, HI, MX, TS, TB, TG, PS, GP, ST, TR, PR, HP, MM, MT, MW, MR, MF, MS, SCL, TN2, TN3, MTS, SG, TM, CG, HQT, HQ2, HQ3, STG, ADA, ESR, LI, INS, FS, TEP, U1, U2, U3, U4, U5, 
                         U6, U7, U8, CID, ISI, DLI, IT, USA, PSV, CTY, MMN, GN, TOG, CT, HQP, SIT, ET, EE, PKT, CSC, CNC, ACC, OIT, MSC, NCA, HQC, TP1, TP2, TP3, AR, SR1, SR2, SR3, FSQ, CSQ, ES, AC, NCI, CH, ETR, PC, MSGE, AE, AU, CL, DEL, 
                         DTS, CCO)
SELECT SC, SE, PD, BL, SM, DY, CN, TN, RM, CR, SX, LO, HI, MX, TS, TB, TG, PS, GP, ST, TR, PR, HP, MM, MT, MW, MR, MF, MS, SCL, TN2, TN3, MTS, SG, TM, CG, HQT, HQ2, HQ3, STG, ADA, ESR, LI, INS, FS, TEP, U1, U2, U3, U4, U5, 
                         U6, U7, U8, CID, ISI, DLI, IT, USA, PSV, CTY, MMN, GN, TOG, CT, HQP, SIT, ET, EE, PKT, CSC, CNC, ACC, OIT, MSC, NCA, HQC, TP1, TP2, TP3, AR, SR1, SR2, SR3, FSQ, CSQ, ES, AC, NCI, CH, ETR, PC, MSGE, AE, AU, CL, DEL, 
                         DTS, CCO
FROM DST23000AeriesDemo.dbo.SMS WHERE SC = 102
HTML


4. Insert Section Staff records from source database

EXAMPLE:

INSERT SSM (SC, SE, ID, PR, SR, TG, ATP, GBP, GR, SAC, STR, TP, DEL, DTS)
SELECT SC, SE, ID, PR, SR, TG, ATP, GBP, GR, SAC, STR, TP, DEL, DTS
FROM DST23000AeriesDemo.dbo.SSM WHERE SC = 102
SQL


5. Insert Student Course Requests from source database

EXAMPLE:

INSERT SSS (SC, SN, SE, CN, TN, RT, AC, AT, SQ, PL, TM, TG, PF, U1, U2, U3, U4, U5, PS, DEL, DTS)
SELECT SC, SN, SE, CN, TN, RT, AC, AT, SQ, PL, TM, TG, PF, U1, U2, U3, U4, U5, PS, DEL, DTS
FROM DST23000AeriesDemo.dbo.SSS WHERE SC = 102 AND SN IN (SELECT SN FROM STU WHERE DEL = 0 AND SC = 102)
SQL


6. Insert Flex Periods from source database

  • Adjust FTF.YR value 

EXAMPLE:

SET IDENTITY_INSERT FTF ON
SQL
INSERT FTF (SQ, SC, YR, STI, DE, ST, ET, TY, TT, IDT, IUI, IUT, IUN, UUI, UUT, UUN, DEL, DTS)
SELECT SQ, SC, '2023-2024', STI, DE, ST, ET, TY, TT, IDT, IUI, IUT, IUN, UUI, UUT, UUN, DEL, DTS
FROM DST23000AeriesDemo.dbo.FTF WHERE SC = 102
SQL
SET IDENTITY_INSERT FTF OFF
SQL


7. Insert Flex Period Times from source database

EXAMPLE:

SET IDENTITY_INSERT FTT ON
SQL
INSERT FTT (SQ, FSQ, KY, ST, ET, DEL, DTS)
SELECT FTT.SQ, FTT.FSQ, FTT.KY, FTT.ST, FTT.ET, FTT.DEL, FTT.DTS
FROM FTF
  INNER JOIN (SELECT * FROM DST23000AeriesDemo..FTT WHERE DEL = 0) FTT ON FTF.SQ = FTT.FSQ 
WHERE FTF.SC = 102
SQL
SET IDENTITY_INSERT FTT OFF
SQL


8. Insert Class Calendar Records from source database

  • Adjust CCL.YR value

EXAMPLE:

SET IDENTITY_INSERT CCL ON
SQL
INSERT CCL (SQ, SC, YR, STI, DE, DEL, DTS)
SELECT SQ, SC, '2023-2024', STI, DE, DEL, DTS
FROM DST23000AeriesDemo.dbo.CCL WHERE SC = 102
SQL
SET IDENTITY_INSERT CCL OFF
SQL


9. Manually add Calendar Dates in Aeries