# SQL Tags query

**URL:** <https://forum.inductiveautomation.com/t/sql-tags-query/2954>\
**Category:** Ignition\
**Created:** [May 18, 2011, 8:48pm UTC](https://forum.inductiveautomation.com/t/sql-tags-query/2954 "2011-05-18T20:48:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![CSommer](https://avatars.discourse-cdn.com/v4/letter/c/6de8d8/32.png) [@CSommer](https://forum.inductiveautomation.com/u/CSommer)\
**Post date:** [May 18, 2011, 8:48pm UTC](https://forum.inductiveautomation.com/t/sql-tags-query/2954/1 "2011-05-18T20:48:34Z")

</div>

I have setup a SQLtag with a SQL Query as the expression mode. I cannot get the query to evaluate to anything other than null.

SELECT top(1) ActiveUserLogin  
FROM DBName.dbo.Operators  
WHERE (Operators.OperatorLocation = 1)

The query returns the expected value in the sql managment studio but sets the sqltag value to null.  
Any ideas?  
Thanks,  
Chad

---

<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 18, 2011, 9:49pm UTC](https://forum.inductiveautomation.com/t/sql-tags-query/2954/2 "2011-05-18T21:49:43Z")

</div>

You need to specify a default database connection to run your SQL query through in the SQLTags Realtime Provider. Log in to the Ignition Gateway Configuration web page. Select SQLTags \> Realtime and the left hand side. Edit your provider (probably default) and choose a default database. Press Save and your query should work.
