Insert Work tables into MySQL

1.  Begin by setting the Data Status to “Historic”: UPDATE m_schoolannualdata JOIN aa_mi_se_fid_rev ON SfdSadID = SadID SET SadDataStatus = 'Audited', SadHide = 'No'.

2.  Need to delete any financial detail records from the annual data record being inserted. CREATE TABLE Orphans AS (SELECT DISTINCT SfdSadID FROM aa_mi_se_fid_exp); DELETE FROM s_financialdatadetail WHERE SfdSadID IN (SELECT SfdSadID FROM Orphans);

3.  INSERT INTO s_financialdatadetail (SfdMunID, SfdSadID, SfdFtsID, SfdSscID, SfdFundCode, SfdFunctionCode, SfddObjectCode, SfdAmount, SfdDateAdded, SfdDateModified) SELECT SfdMunID, SfdSadID, SfdFtsID, SfdSscID, SfdFundCode, SfdFunctionCode, SfddObjectCode, SfdAmount, SfdDateAdded, SfdDateModified FROM aa_mi_se_fid_rev.

4.  INSERT INTO s_financialdatadetail (SfdMunID, SfdSadID, SfdFtsID, SfdSscID, SfdFundCode, SfdFunctionCode, SfddObjectCode, SfdAmount, SfdDateAdded, SfdDateModified) SELECT SfdMunID, SfdSadID, SfdFtsID, SfdSscID, SfdFundCode, SfdFunctionCode, SfddObjectCode, SfdAmount, SfdDateAdded, SfdDateModified FROM aa_mi_se_fid_exp.

5.  INSERT INTO s_financialdatadetail (SfdMunID, SfdSadID, SfdFtsID, SfdSscID, SfdFundCode, SfdFunctionCode, SfdAmount, SfdDateAdded, SfdDateModified) SELECT SfdMunID, SfdSadID, SfdFtsID, SfdSscID, SfdFundCode, SfdFunctionCode, SfdAmount, SfdDateAdded, SfdDateModified FROM aa_mi_se_fid_bal.

6.  Run the stored SQL statements named “SE Update Fiscal Score Data One Year”. Make sure to change the State Code and Fiscal Year.

7.  Run “Test SE Process School Scores” to recalculate all the fiscal scores.

8.  Recache the School Directory.