How to delete selected sys_history_line records but not all audit entries?

Natalie H
Tera Contributor

We have a couple of custom fields we're disabling audit for, and want to delete the historical audit entries for these fields only - not all audit records for the table. 

 

Querying sys_history_line to identify the records by field name/table doesn't work because I haven't accessed these records before (i.e. History line does not show results when trying to ... - ServiceNow Community).

 

Is there any way we can get around the above challenge with a script?

 

Thanks.

 

 

 

6 REPLIES 6

Hi Anurag,

Thanks for sharing. I can see if I directly query the sys_audit table I always get results, so will explore this further. 

Natalie. 

 

Saurabh Gupta
Kilo Patron
Kilo Patron

Hi,
You can delete those fields from sys_audit.

 

 


Thanks and Regards,

Saurabh Gupta