# DB tag binding to SQL query

**URL:** <https://forum.inductiveautomation.com/t/db-tag-binding-to-sql-query/1829>\
**Category:** Ignition\
**Created:** [May 10, 2010, 2:48pm UTC](https://forum.inductiveautomation.com/t/db-tag-binding-to-sql-query/1829 "2010-05-10T14:48:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adamabelew](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@adamabelew](https://forum.inductiveautomation.com/u/adamabelew)\
**Post date:** [May 10, 2010, 2:48pm UTC](https://forum.inductiveautomation.com/t/db-tag-binding-to-sql-query/1829/1 "2010-05-10T14:48:33Z")

</div>

OK, I am missing something very simple here (I think).

I am attempting to bind a DB tag to a value in my SQL database. I have attempted the following:

```auto
SELECT value FROM table WHERE Idx = 1
```

This is not working for me. Should I be using a system.db function? Is this something that I need not to be doing? I have this query working as a dynamic property for one of the windows, but want to be able to access it when this window is not active.

Thanks.

Adam

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [May 10, 2010, 5:09pm UTC](https://forum.inductiveautomation.com/t/db-tag-binding-to-sql-query/1829/2 "2010-05-10T17:09:41Z")

</div>

The SQLTags realtime provider needs to have your DB selected as the default in order to run that query. You can set this in the Ignition Gateway configuration by editing the default SQLTags provider under SQLTags -\> Realtime.
