# Historical sqltags with tags deleted and recreated

**URL:** <https://forum.inductiveautomation.com/t/historical-sqltags-with-tags-deleted-and-recreated/9897>\
**Category:** Ignition\
**Created:** [April 9, 2015, 7:13pm UTC](https://forum.inductiveautomation.com/t/historical-sqltags-with-tags-deleted-and-recreated/9897 "2015-04-09T19:13:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [April 9, 2015, 7:13pm UTC](https://forum.inductiveautomation.com/t/historical-sqltags-with-tags-deleted-and-recreated/9897/1 "2015-04-09T19:13:10Z")

</div>

We have the following issue with historical sqltags.

In our development workflow, we need to very often delete and recreate sqltags with the same full tags paths.  
when tag are recreated new id are generated for historical tag definition in sqlt\_te table.  
So old historical data which are binded to old id are lost.

We would like when tag are recreated that old ids are reused in sqlt\_te instead of creating new ids.  
Is there a way to do that or to make a sync between realtime historical definition and sqlt\_te table ?

---

<div class="post-metadata">

**Author:** ![sngeru](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@sngeru](https://forum.inductiveautomation.com/u/sngeru)\
**Post date:** [April 15, 2015, 3:36pm UTC](https://forum.inductiveautomation.com/t/historical-sqltags-with-tags-deleted-and-recreated/9897/2 "2015-04-15T15:36:28Z")

</div>

To get started I have two questions for you:

1. Is there a reason why the tag id has to be reused when recreating the tag?
2. Are you manually deleting/altering any entries sqlt\_te table when a tag is deleted?

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [April 16, 2015, 6:52pm UTC](https://forum.inductiveautomation.com/t/historical-sqltags-with-tags-deleted-and-recreated/9897/3 "2015-04-16T18:52:33Z")

</div>

1. I suppose unique id for one tag path is the only way to be able to query all tag history from easy chart
2. No

It’s seem that id are not recreated for the same tag path, when tag are deleted and recreated if the history db is well connected during these action.

perhaps the case occur when history db is disconnected when tag are deleted ? or when tag are recreated ?

---

<div class="post-metadata">

**Author:** ![dave.fogle](https://avatars.discourse-cdn.com/v4/letter/d/43a26b/32.png) [@dave.fogle](https://forum.inductiveautomation.com/u/dave.fogle)\
**Post date:** [April 23, 2015, 8:31pm UTC](https://forum.inductiveautomation.com/t/historical-sqltags-with-tags-deleted-and-recreated/9897/4 "2015-04-23T20:31:46Z")

</div>

I feel like you shouldn't be having this issue. If the tag is being recreated with the exact same path in the same historical provider on the same machine then the system should still see and return the old historical data from before you deleted and recreated. I have seen on rare occasions the old tagid still used to store data after it's been retired , but in that scenario you don't see any new data.

What version of Ignition are you currently running?

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [April 23, 2015, 8:54pm UTC](https://forum.inductiveautomation.com/t/historical-sqltags-with-tags-deleted-and-recreated/9897/5 "2015-04-23T20:54:38Z")

</div>

7.7.3 or7.7.4  
We will test more closely as soon as possible. I will keep you posted if we reproduce the issue and the test workflow
