# storeTagHistory() seems to be writing to DB but I cant see the inserted data anywhere

**URL:** <https://forum.inductiveautomation.com/t/storetaghistory-seems-to-be-writing-to-db-but-i-cant-see-the-inserted-data-anywhere/108747>\
**Category:** Ignition\
**Created:** [July 21, 2025, 11:06pm UTC](https://forum.inductiveautomation.com/t/storetaghistory-seems-to-be-writing-to-db-but-i-cant-see-the-inserted-data-anywhere/108747 "2025-07-21T23:06:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![MC2338](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@MC2338](https://forum.inductiveautomation.com/u/MC2338)\
**Post date:** [July 21, 2025, 11:06pm UTC](https://forum.inductiveautomation.com/t/storetaghistory-seems-to-be-writing-to-db-but-i-cant-see-the-inserted-data-anywhere/108747/1 "2025-07-21T23:06:27Z")

</div>

I am using the function below to try to add data to my historian DB. When i run this in script console it seems to compile with no errors. I added a few lines to the script to query and print the historical data that i'm inserting and that comes back with no values. If i run it more than once for a date/time then i get a log message error saying that it could not insert because of a duplicate timestamp. I have a tag history table configured for this tag and I do not see any of the values that are supposedly being inserted into the historical database. What is going wrong here??

```python
histProv = "Ignition_Hist"
tagProv = "HIST_Dashboard"
paths = "[HIST_Dashboard]LYO 1/Unit Test/Alarm/LYO1_Phase1_LeakRate"
histDate = system.date.getDate(2024, 7, 17)
histDateTime = system.date.setTime(histDate, 10, 07, 44)
date = histDateTime
system.tag.storeTagHistory(histProv, tagProv, [paths], [6.9], [202], [histDateTime])

```

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 21, 2025, 11:11pm UTC](https://forum.inductiveautomation.com/t/storetaghistory-seems-to-be-writing-to-db-but-i-cant-see-the-inserted-data-anywhere/108747/2 "2025-07-21T23:11:23Z")

</div>

> [@MC2338](#):
>
> histDate = system.date.getDate(2024, 7, 17)

The months in `getDate` are zero indexed - are you looking in the July partition, or the June one?

---

<div class="post-metadata">

**Author:** ![MC2338](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@MC2338](https://forum.inductiveautomation.com/u/MC2338)\
**Post date:** [July 21, 2025, 11:16pm UTC](https://forum.inductiveautomation.com/t/storetaghistory-seems-to-be-writing-to-db-but-i-cant-see-the-inserted-data-anywhere/108747/4 "2025-07-21T23:16:31Z")

</div>

I was trying to view the tag history in a table component with date parameters but even with the dates wide open (like may to august) i am not seeing the values that I am writing. Next step will be to start digging through the partitions. I did see a log message that said a partition was created when I was first trying to write this data.  
edit: we are writing data for 2024 because we do not currently have any data for this tag that old and i think thats why i saw a log that a partition was created

---

<div class="post-metadata">

**Author:** ![nideyijuyidong](https://avatars.discourse-cdn.com/v4/letter/n/7cd45c/32.png) [@nideyijuyidong](https://forum.inductiveautomation.com/u/nideyijuyidong)\
**Post date:** [July 22, 2025, 2:01am UTC](https://forum.inductiveautomation.com/t/storetaghistory-seems-to-be-writing-to-db-but-i-cant-see-the-inserted-data-anywhere/108747/5 "2025-07-22T02:01:37Z")

</div>

There is content about _tagid, created, retired_,[https://www.docs.inductiveautomation.com/docs/8.1/appendix/reference-pages/ignition-database-table-reference#sqlth\_te](https://www.docs.inductiveautomation.com/docs/8.1/appendix/reference-pages/ignition-database-table-reference#sqlth_te) but I don't think that is very intuitive. I prefer not to use the storeTagHistory method, but to manually query the tagid, modify the _created_ value, and then write the data to the table for the corresponding month.

---

<div class="post-metadata">

**Author:** ![MC2338](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@MC2338](https://forum.inductiveautomation.com/u/MC2338)\
**Post date:** [July 22, 2025, 7:54pm UTC](https://forum.inductiveautomation.com/t/storetaghistory-seems-to-be-writing-to-db-but-i-cant-see-the-inserted-data-anywhere/108747/6 "2025-07-22T19:54:03Z")

</div>

So i can insert rows directly into a partition table from SQL? Is that what you are recommending? I cant edit existing entries because there are no existing entries for that tag id for the time period we wish to write data on

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 22, 2025, 8:52pm UTC](https://forum.inductiveautomation.com/t/storetaghistory-seems-to-be-writing-to-db-but-i-cant-see-the-inserted-data-anywhere/108747/7 "2025-07-22T20:52:46Z")

</div>

You _can_, because it's just rows in a database, after all. I would definitely **not** recommend it.

---

<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:** [July 22, 2025, 10:18pm UTC](https://forum.inductiveautomation.com/t/storetaghistory-seems-to-be-writing-to-db-but-i-cant-see-the-inserted-data-anywhere/108747/8 "2025-07-22T22:18:11Z")

</div>

So you want to add historical data to your current history tables, which means you probably moved from one historian to another?

I have attempted to do this as well, with variable success, except to make sure the tag paths and id's match up in the new historian tables.

Could you run an import in your SQL manager into temp tables, clean the data to match tag paths and id's?

And like Paul said, dynamically renaming columns in the DB is a bad idea.
