# SQL Tags Historian problem

**URL:** <https://forum.inductiveautomation.com/t/sql-tags-historian-problem/5042>\
**Category:** Ignition\
**Created:** [August 22, 2012, 5:14pm UTC](https://forum.inductiveautomation.com/t/sql-tags-historian-problem/5042 "2012-08-22T17:14:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alanb](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@alanb](https://forum.inductiveautomation.com/u/alanb)\
**Post date:** [August 22, 2012, 5:14pm UTC](https://forum.inductiveautomation.com/t/sql-tags-historian-problem/5042/1 "2012-08-22T17:14:18Z")

</div>

I’m not sure how to describe this problem.  
My best guess is Ignition expects the history database to be at the the same location as the default database. I’m getting the errors found in my attachment.

Also, this same configuration works if the default and historical database are at the same location.

Alan  
[History DB 1.pdf](https://us1.discourse-cdn.com/inductiveautomation/original/2X/1/10b8ac7ffc82f4d4ba313c52b93b538452ca7ac7.pdf) (91.4 KB)

---

<div class="post-metadata">

**Author:** ![James.Lorenz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/james.lorenz/32/3290_2.png) [@James.Lorenz](https://forum.inductiveautomation.com/u/James.Lorenz)\
**Post date:** [August 22, 2012, 5:41pm UTC](https://forum.inductiveautomation.com/t/sql-tags-historian-problem/5042/2 "2012-08-22T17:41:05Z")

</div>

What steps did you take to come across this error? Are you using the built-in tag history function in the tag pens property binding, or are you bringing in the data in another way? If you’re bringing the data in another way, please outline your implementation.

---

<div class="post-metadata">

**Author:** ![Robert](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@Robert](https://forum.inductiveautomation.com/u/Robert)\
**Post date:** [August 22, 2012, 6:08pm UTC](https://forum.inductiveautomation.com/t/sql-tags-historian-problem/5042/3 "2012-08-22T18:08:16Z")

</div>

It’s system.tag.queryTagHistory() that returns the error

---

<div class="post-metadata">

**Author:** ![James.Lorenz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/james.lorenz/32/3290_2.png) [@James.Lorenz](https://forum.inductiveautomation.com/u/James.Lorenz)\
**Post date:** [August 22, 2012, 6:29pm UTC](https://forum.inductiveautomation.com/t/sql-tags-historian-problem/5042/4 "2012-08-22T18:29:46Z")

</div>

Then the assumption is correct, when making query calls from a script, Ignition uses the default database if there is no database explicitly specified. This is because theoretically one tag can have historical data spread across different database tables.

If you put the historical provider for that tag in the path, it should get rid of the error:

paths = [‘[dbname]Substation X/DNP Demo Data/T1-A’ ]

---

<div class="post-metadata">

**Author:** ![alanb](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@alanb](https://forum.inductiveautomation.com/u/alanb)\
**Post date:** [August 22, 2012, 9:25pm UTC](https://forum.inductiveautomation.com/t/sql-tags-historian-problem/5042/5 "2012-08-22T21:25:56Z")

</div>

That works!

Thanks.

Alan
