# Event trigger for Query tag when db table record is added and deleted

**URL:** <https://forum.inductiveautomation.com/t/event-trigger-for-query-tag-when-db-table-record-is-added-and-deleted/56304>\
**Category:** Ignition\
**Created:** [February 18, 2022, 2:11pm UTC](https://forum.inductiveautomation.com/t/event-trigger-for-query-tag-when-db-table-record-is-added-and-deleted/56304 "2022-02-18T14:11:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hewking32](https://avatars.discourse-cdn.com/v4/letter/h/b5ac83/32.png) [@hewking32](https://forum.inductiveautomation.com/u/hewking32)\
**Post date:** [February 18, 2022, 2:11pm UTC](https://forum.inductiveautomation.com/t/event-trigger-for-query-tag-when-db-table-record-is-added-and-deleted/56304/1 "2022-02-18T14:11:36Z")

</div>

hi  
I have a View in DB which is linked to Query tag. I believe its good idea not to trigger it based on time but rather an event - right?  
My idea is as follow:  
1 When record is added in the table or deleted we need to update the query tag so a trigger will be created in the table to toggle the binary flag kept in other table to True  
2 Binary flag is linked via transaction manager to memory tag which will become True  
3 Memory Flag will be used as event to trigger query tag expression

Does it sound right?  
1 Does storing just one single bit flag in separate table not seem very strange?  
2 how to reset the memory flag back to FALSE - as a tag event ? if yes then would it not prevent query tag event from triggering?

@pturmel Would you be so kind to suggest anything?  
@bkarabinchak.psi you also helped me in the past 🙂  
Regards
