# SQL for finding SQLtags with "ACK MODE" set to "Auto"

**URL:** <https://forum.inductiveautomation.com/t/sql-for-finding-sqltags-with-ack-mode-set-to-auto/2231>\
**Category:** Archived Topics\
**Created:** [September 30, 2010, 1:28pm UTC](https://forum.inductiveautomation.com/t/sql-for-finding-sqltags-with-ack-mode-set-to-auto/2231 "2010-09-30T13:28:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rthomas](https://avatars.discourse-cdn.com/v4/letter/r/ad7895/32.png) [@rthomas](https://forum.inductiveautomation.com/u/rthomas)\
**Post date:** [September 30, 2010, 1:28pm UTC](https://forum.inductiveautomation.com/t/sql-for-finding-sqltags-with-ack-mode-set-to-auto/2231/1 "2010-09-30T13:28:29Z")

</div>

I’d like to find the tags set to ackmode = auto, and change them to ackmode = Manual.

Can you help me with this SQL. Thank you.

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [September 30, 2010, 3:32pm UTC](https://forum.inductiveautomation.com/t/sql-for-finding-sqltags-with-ack-mode-set-to-auto/2231/2 "2010-09-30T15:32:23Z")

</div>

Here is a query to achieve that:`SELECT * FROM sqlt_core s WHERE (SELECT COUNT(*) FROM sqlt_meta m WHERE m.tagid = s.id AND m.name = 'AlertMode' AND m.intval = 1) > 0 AND COALESCE((SELECT m.intval FROM sqlt_meta m WHERE m.tagid = s.id AND m.name = 'AlertAckMode'), 1) != 2;`
