Truncating HEATNote and HEATMsg without Deleting Alarms

Version 1

    Details

    Is it possible to truncate the contents of the HEATNote and HEATMsg tables without affecting the Alarms?


    Resolution

     

    To delete the contents of the HEATNote and HEATMsg table without deleting Alarms:


    1.  First run this query to remove all non-Alarm related HEATMsg rows:
    DELETE FROM HEATMSg WHERE MType <> 'A'

    2.  Run the following query to delete all non-Alarm related HEATNote rows
    DELETE FROM HEATNote WHERE MMsgID NOT IN 
    (SELECT MMsgID FROM HEATMSg WHERE MType = 'A')