How to restore the Letter Log and Letter Tags when the "Zero Student Absence 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.LT
- Make a backup of the STU table before making this change
- Update the STU.LT field with the data from the restored database
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
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