# Deleted tags not retired in sqlth\_te table

**URL:** <https://forum.inductiveautomation.com/t/deleted-tags-not-retired-in-sqlth-te-table/5274>\
**Category:** Ignition\
**Created:** [October 15, 2012, 1:30pm UTC](https://forum.inductiveautomation.com/t/deleted-tags-not-retired-in-sqlth-te-table/5274 "2012-10-15T13:30:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gadgetguru69](https://avatars.discourse-cdn.com/v4/letter/g/e274bd/32.png) [@gadgetguru69](https://forum.inductiveautomation.com/u/gadgetguru69)\
**Post date:** [October 15, 2012, 1:30pm UTC](https://forum.inductiveautomation.com/t/deleted-tags-not-retired-in-sqlth-te-table/5274/1 "2012-10-15T13:30:06Z")

</div>

I am using the sqlth\_te table for trending to select available tags that are configured to log to the DB. Problem is that i would have thought that the retired timestamp would designate the tags that were no longer logging. For some reason i have a lot of tags that have been deleted from project now that dont show a retired timestamp.

My question is one when are you updating the retired field? And what is the best option for resolving this in existing db?

---

<div class="post-metadata">

**Author:** ![Colby.Clegg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/colby.clegg/32/3282_2.png) [@Colby.Clegg](https://forum.inductiveautomation.com/u/Colby.Clegg)\
**Post date:** [October 15, 2012, 5:20pm UTC](https://forum.inductiveautomation.com/t/deleted-tags-not-retired-in-sqlth-te-table/5274/2 "2012-10-15T17:20:06Z")

</div>

Hi,

Your idea is correct, deleted tags should get retired, but currently that value is only set when tags are updated. In other words, the system currently keeps one non-retired tag for each address, even if the tag no longer exists.

We have had the intention for a while to add various facilities for cleaning up tags that are no longer in use. Also, delete tags should probably be marked as retired automatically, with facilities for permanently removing them, or allowing them to still be visible.

In the mean time, you can mark tags as retired manually by setting a timestamp on that column, if you don’t want them to appear in the historical tag list. However, I would urge some caution with deleting from that table- if rows get deleted in error, it is virtually impossible to relink them with their data. So, make sure you have a backup of that table before you do anything.

Regards,

---

<div class="post-metadata">

**Author:** ![gadgetguru69](https://avatars.discourse-cdn.com/v4/letter/g/e274bd/32.png) [@gadgetguru69](https://forum.inductiveautomation.com/u/gadgetguru69)\
**Post date:** [October 15, 2012, 6:36pm UTC](https://forum.inductiveautomation.com/t/deleted-tags-not-retired-in-sqlth-te-table/5274/3 "2012-10-15T18:36:18Z")

</div>

Kind of what i was thinking. I will go in and set the retired fields on the ones that no longer exist for now.

Thanks

---

<div class="post-metadata">

**Author:** ![shibubalaji](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/shibubalaji/32/9165_2.png) [@shibubalaji](https://forum.inductiveautomation.com/u/shibubalaji)\
**Post date:** [October 30, 2019, 6:50pm UTC](https://forum.inductiveautomation.com/t/deleted-tags-not-retired-in-sqlth-te-table/5274/4 "2019-10-30T18:50:25Z")

</div>

> [@Colby.Clegg](#):
>
> deleted tags should get retired

Colby,  
Can all retired tags be deleted from sqlth\_te? By doing so, will not loose any historical data, is nt it?
