How to get rid of "old" deleted tag records in sqlth_te

Hi

When making sets of tags and using copy/paste method if tag contains history enable Ignition will make records ind sqlth_te table as expected but if deleting those tags all recors remain.
I can understand that this can be usefully if making mistake when deleting tags, but in our project we use sqlth_te table also for cheking which tags contains trend and based on that and tagpath it will generate automatically trend displays.

Now problem is that our query will return also tagpaths which are only in records because of copying tags.
so tagpaths normally looks like measure(1)…

Is there any easy way to check SQL Tag internal provider tags and delete all other records from sqlth_te?

Br
Tommi

Unfortunately there isn’t an easy way to check, though we’re very aware of this issue. I hope to address it in 7.4.

Regards,

Hi Colby

I there any problem if I add column on sqlth_te table where I told is tag enabled or not?
This could be better solution than just delete records.

Br
Tommi

Hi,

Yes, you could do this. Obviously it would just be for your own use, but it won’t hurt anything. In 7.3, we added a “retired” column which does get used for querying, to avoid loading data for tags when they no longer are active, but it is currently only updated when a new version of the tag is inserted. In the future (and hopefully not very long!), what the system would do would be to look at the active tags, and mark any tags that no longer exist as retired. When tags are deleted, it will mark them right away. That way, we won’t delete any data, but also will be able to keep the tag lists clean by only showing paths that are non-retired. Then, we could have an option to clean up the retired tag data (and just as a small point, the system would be better at handling tag moves/renames).

Regards,

Hi

Good, then I can use this method.
There is another plan for this to use exported tag csv file to import database and use that for “active” tags table.
Maybe import only paths where tagtype = 0 , that should do a job ?

Br
Tommi