# History tag table sqlth\_te retired and fingerprint columns

**URL:** <https://forum.inductiveautomation.com/t/history-tag-table-sqlth-te-retired-and-fingerprint-columns/49543>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [August 4, 2021, 11:39am UTC](https://forum.inductiveautomation.com/t/history-tag-table-sqlth-te-retired-and-fingerprint-columns/49543 "2021-08-04T11:39:32Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [August 4, 2021, 11:39am UTC](https://forum.inductiveautomation.com/t/history-tag-table-sqlth-te-retired-and-fingerprint-columns/49543/1 "2021-08-04T11:39:32Z")

</div>

I’m trying to get a full list of all historic tags and thought the most efficient and most importantly fast method to do this would be to query the sqlth\_te table. I don’t want to show invalid/no-longer-existent tags, so I’ve filtered out `retired` values that are non-NULL. Looking at the data however that was returned with this simple query, I noticed some rows returned that shouldn’t be there as the tags no longer exist but their retired field is still NULL.  
For context:  
Query:

```auto
SELECT tagpath FROM sqlth_te where retired IS NULL

```

Count: 31,902  
Number of those tags that no longer exist: 14,536 (46%!!!)

I’m also wondering what the `fingerprint` column is for? I looked in the SDK and it’s not listed in the specs, but it seems to store the OPC-UA item path of the tag. However a lot of tags/rows are missing this and this is just NULL. What’s the reason for this? (this system was upgraded from 7.9.9 to 8 about 1.5yrs ago if it’s relevant).

[https://docs.inductiveautomation.com/display/SE/Tag+History+Tables+Reference](https://docs.inductiveautomation.com/display/SE/Tag+History+Tables+Reference)

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [August 4, 2021, 12:03pm UTC](https://forum.inductiveautomation.com/t/history-tag-table-sqlth-te-retired-and-fingerprint-columns/49543/2 "2021-08-04T12:03:53Z")

</div>

There was a bug at one point in 7.9, I’m not sure of when/if it was cleared up, where historical tags were not marked as retired properly. Support helped me clear up a bunch of these back in 7.9.3. May not be relevant for this case.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [August 4, 2021, 12:05pm UTC](https://forum.inductiveautomation.com/t/history-tag-table-sqlth-te-retired-and-fingerprint-columns/49543/3 "2021-08-04T12:05:26Z")

</div>

> [@lrose](#):
>
> Support helped me clear up a bunch of these back in 7.9.3.

That's what I'm doing at the moment 😕 Just triple checking they're _ **not** _ actually there...

---

<div class="post-metadata">

**Author:** ![Wouter](https://avatars.discourse-cdn.com/v4/letter/w/e99b99/32.png) [@Wouter](https://forum.inductiveautomation.com/u/Wouter)\
**Post date:** [April 29, 2022, 10:23am UTC](https://forum.inductiveautomation.com/t/history-tag-table-sqlth-te-retired-and-fingerprint-columns/49543/4 "2022-04-29T10:23:18Z")

</div>

We’ve had the same problem and we noticed that this post: [[What Causes a History Tag to be Retired - #2 by PGriffith](https://forum.inductiveautomation.com/t/what-causes-a-history-tag-to-be-retired/18933/2)] doesn’t seem to be relevant anymore. In our project tags only get retired if the history is true and the tag gets deleted. If you disable the tag or turn history off and then delete the tag the retire column will stay null forever.

Which is a problem for us since the tag browser tree component will show these non-retired tags. Has anyone found a solution for this? Since now our only option seems to be to manually retire each tag in the database by adding a random number to the retire column.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [April 29, 2022, 10:35am UTC](https://forum.inductiveautomation.com/t/history-tag-table-sqlth-te-retired-and-fingerprint-columns/49543/5 "2022-04-29T10:35:54Z")

</div>

> [@Wouter](#):
>
> adding a random number to the retire column

Why add a random number and not the current unix time?  
Definitely sounds like an issue. I have a script to find orphaned tags in sqlth\_te and retire them via script.

---

<div class="post-metadata">

**Author:** ![Wouter](https://avatars.discourse-cdn.com/v4/letter/w/e99b99/32.png) [@Wouter](https://forum.inductiveautomation.com/u/Wouter)\
**Post date:** [April 29, 2022, 11:18am UTC](https://forum.inductiveautomation.com/t/history-tag-table-sqlth-te-retired-and-fingerprint-columns/49543/6 "2022-04-29T11:18:12Z")

</div>

Using the current unix time indeed makes more sense. Would you want to share this script?

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [April 29, 2022, 11:19am UTC](https://forum.inductiveautomation.com/t/history-tag-table-sqlth-te-retired-and-fingerprint-columns/49543/7 "2022-04-29T11:19:53Z")

</div>

```auto
now = system.date.now()
now.time

```

Edit: Oh you probably meant the other script whoops, I’ll have to get back to you as i’m not at my laptop

---

<div class="post-metadata">

**Author:** ![Wouter](https://avatars.discourse-cdn.com/v4/letter/w/e99b99/32.png) [@Wouter](https://forum.inductiveautomation.com/u/Wouter)\
**Post date:** [May 3, 2022, 2:09pm UTC](https://forum.inductiveautomation.com/t/history-tag-table-sqlth-te-retired-and-fingerprint-columns/49543/8 "2022-05-03T14:09:31Z")

</div>

Yes it was, If you’d be able to share that it would be awesome.

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [May 3, 2022, 2:51pm UTC](https://forum.inductiveautomation.com/t/history-tag-table-sqlth-te-retired-and-fingerprint-columns/49543/9 "2022-05-03T14:51:08Z")

</div>

I tend to use the latest retired stamp from the table.  
So you can just do a

> SELECT TOP 1 [retired] FROM sqlth\_te ORDER BY [retired] DESC

And then update the record using that value in the script.

---

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [October 24, 2025, 8:38pm UTC](https://forum.inductiveautomation.com/t/history-tag-table-sqlth-te-retired-and-fingerprint-columns/49543/10 "2025-10-24T20:38:05Z")

</div>

Curious, did you ever find that script?

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [October 25, 2025, 8:21am UTC](https://forum.inductiveautomation.com/t/history-tag-table-sqlth-te-retired-and-fingerprint-columns/49543/11 "2025-10-25T08:21:15Z")

</div>

Shouldn’t be much more complicated than fetching the paths and ids, testing them with `system.tag.exists` to build a list of tags to retire, then write a timestamp for these rows.

If you need a first draft, I can write that for you, but you’ll have to test it yourself
