How to restore the Letter Log and Letter Tags when 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.L2

  • Make a backup of the STU table before making this change
  • Update the STU.L2 field with the data from the restored database 

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)

  • Make a backup of the LTL table before making this change
  • Update the LTL.CIS field with the data from the restored database 

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