# Find all tags that have history enabled

**URL:** <https://forum.inductiveautomation.com/t/find-all-tags-that-have-history-enabled/78576>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [August 30, 2023, 7:15pm UTC](https://forum.inductiveautomation.com/t/find-all-tags-that-have-history-enabled/78576 "2023-08-30T19:15:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bushmatic](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bushmatic/32/87014_2.png) [@Bushmatic](https://forum.inductiveautomation.com/u/Bushmatic)\
**Post date:** [August 30, 2023, 7:15pm UTC](https://forum.inductiveautomation.com/t/find-all-tags-that-have-history-enabled/78576/1 "2023-08-30T19:15:04Z")

</div>

We are working with a tangled web of legacy projects and tags that have little to no documentation. I am trying to find a handful of tags that are logging history over an SQL database connection named something to the effect of "Machine\_Data". There are lots of workcells in this database, each with its own dedicated table, and each table is actively recording all kinds of data - open time, amperage, fault codes, forces, you get the idea. Entries on these tables span back a couple years and are still logging data today.

This is all well and good, but we are in a position where we need to expand this capability out to some more workcells in our facility. Only problem is, for the life of me I can't find the tags in Ignition that are doing this. I'm wondering if I can summon a list of all tags that have history enabled. I wasn't able to search for active database connections to this Machine\_Data database. I also did all kinds of searches for the table names, field names, workcell names, and so on. 0 results every time.

I'm just hoping some more experienced Ignition users out there might share how they would go about investigating this system. I'm relatively new to the software and feel like I'm missing something obvious.

---

<div class="post-metadata">

**Author:** ![Felipe\_CRM](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@Felipe\_CRM](https://forum.inductiveautomation.com/u/Felipe_CRM)\
**Post date:** [August 30, 2023, 7:20pm UTC](https://forum.inductiveautomation.com/t/find-all-tags-that-have-history-enabled/78576/2 "2023-08-30T19:20:52Z")

</div>

If it's using the Tag Historian, then there should be a table named `sqlth_te` in your database that holds tag names for historical tags. As long as the `retired` column is `NULL` the tags are still active. To get the provider as well you can do a JOIN with `sqlth_scinfo` to match `scid` with `sqlth_scinfo.id` and then to `sqlth_drv` to match `drvid` to `sqlth_drv.id`.

EDIT: Missed a step in the JOIN. Query below:

```auto
SELECT provider, tagpath, created, retired
FROM sqlth_te JOIN sqlth_scinfo
ON scid = sqlth_scinfo.id
JOIN sqlth_drv
ON drvid = sqlth_drv.id

```

---

<div class="post-metadata">

**Author:** ![Felipe\_CRM](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@Felipe\_CRM](https://forum.inductiveautomation.com/u/Felipe_CRM)\
**Post date:** [August 30, 2023, 7:30pm UTC](https://forum.inductiveautomation.com/t/find-all-tags-that-have-history-enabled/78576/3 "2023-08-30T19:30:41Z")

</div>

The built-in solution seems to be the Tag Report Tool, as mentioned in this topic:

> [@List of All Historical Tags](https://forum.inductiveautomation.com/t/list-of-all-historical-tags/66594):
>
> New to Ignition so I apologize if this is an easy one... I have an Ignition SCADA delivered from the vendor and want to get a full list of the tags used that are configured for Tag History. I can't seem to find a way to do this in the Designer as the tag export doesn't give the history parameters. Is there a way to list all the tags that have "History Enabled" and ideally what the history parameters are? I have thousands of tags so going manually through the Tag Browser will take years.

Just for completeness's sake, there's also a script in this topic:

> [@How to find all tags configured with tag history?](https://forum.inductiveautomation.com/t/how-to-find-all-tags-configured-with-tag-history/51675/2):
>
> Try running the following code in your script console. Note that if your tags exist under a tag provider other than ‘[default]’, you’ll need to change line 5 to reflect that. If there are thousands of tags with history configured, the printed results may be too long to see them all in the script console, so they may need to be written to giant string which is saved directly to your workstation as a .txt file once the for loop has completed. Edit: I should probably state that the following will …

---

<div class="post-metadata">

**Author:** ![Bushmatic](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bushmatic/32/87014_2.png) [@Bushmatic](https://forum.inductiveautomation.com/u/Bushmatic)\
**Post date:** [August 30, 2023, 7:42pm UTC](https://forum.inductiveautomation.com/t/find-all-tags-that-have-history-enabled/78576/4 "2023-08-30T19:42:19Z")

</div>

Wow! You just sent me down a rabbit hole. I found that sqlth\_te table and everything. Those links are perfect. Thank you so much for the quality answer. I still have some investigating to do but I'm confident I'll be able to figure it out with all this...

---

<div class="post-metadata">

**Author:** ![Felipe\_CRM](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@Felipe\_CRM](https://forum.inductiveautomation.com/u/Felipe_CRM)\
**Post date:** [August 30, 2023, 7:49pm UTC](https://forum.inductiveautomation.com/t/find-all-tags-that-have-history-enabled/78576/5 "2023-08-30T19:49:09Z")

</div>

If you're on 8.1.19 or later, that Tag Report Tool is honestly really nice. It took about 5 seconds to find all the historical tags on a given provider:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/6/e6e6cde0a2bf8b3d56ab721917601d5a4798ab74.png)

Only issue seems to be that it can only do one tag provider at a time, unlike the SQL method.

---

<div class="post-metadata">

**Author:** ![Bushmatic](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bushmatic/32/87014_2.png) [@Bushmatic](https://forum.inductiveautomation.com/u/Bushmatic)\
**Post date:** [August 30, 2023, 7:57pm UTC](https://forum.inductiveautomation.com/t/find-all-tags-that-have-history-enabled/78576/6 "2023-08-30T19:57:02Z")

</div>

We are unfortunately on version 8.1.18! Maybe it is time for an update. That looks like a really useful tool.
