How to restore the Letter Log and Letter Tags when the "Zero Student Absence Letter Counters" and/or the "Zero Student Tardy Letter Counters" button is accidentally pressed.


Step 1: Restore a backup

  • Restore a backup of the database that was taken prior to the letter counters being reset. 
  • If the date/time of the button being pressed is unknown, the LOG table can be queried to identify the exact date/time

EXAMPLE:

SELECT * FROM LOG WHERE CD = 'OPTCHG' AND RCD LIKE '%Reset Letter Absent' AND SC = 994


Step 2: Update STU fields

    Option 1: If "Zero Student Absence Letter Counters" was pressed, update STU.LT

  • To restore the letter tag to its previous value, update STU.LT in the live database with the data from the restored database
  • Make a backup of the STU table before making this change
  • Update the STU.LT field

EXAMPLE:

UPDATE A 
SET A.LT = B.LT
FROM STU A
INNER JOIN (SELECT * FROM DST23000AeriesDemo_Backup..STU WHERE DEL = 0) B ON A.SC = B.SC AND A.SN = B.SN
WHERE A.DEL = 0 AND A.LT <> B.LT

    

    Option 2: If "Zero Student Tardy Letter Counters" was pressed, update STU.L2

  • To restore the letter tag to its previous value, update STU.L2 in the live database with the data from the restored database
  • Make a backup of the STU table before making this change
  • Update the STU.L2 field

EXAMPLE:

UPDATE A 
SET A.L2 = B.L2
FROM STU A
INNER JOIN (SELECT * FROM DST23000AeriesDemo_Backup..STU WHERE DEL = 0) B ON A.SC = B.SC AND A.SN = B.SN
WHERE A.DEL = 0 AND A.L2 <> B.L2


Step 3: Update LTL.CIS (Count in Sequence)

  • To restore the letter tag to its previous value, update LTL.CIS in the live database with the data from the restored database
  • Make a backup of the LTL table before making this change
  • Update the LTL.CIS field

EXAMPLE:

UPDATE A 
SET A.CIS = B.CIS
FROM LTL A
INNER JOIN (SELECT * FROM DST23000AeriesDemo_Backup..LTL WHERE DEL = 0) B ON A.PID = B.PID AND A.ID = B.ID AND A.DT = B.DT AND A.PT = B.PT
WHERE A.DEL = 0 AND A.CIS <> B.CIS