# SQLQuery tags in UDT

**URL:** <https://forum.inductiveautomation.com/t/sqlquery-tags-in-udt/11944>\
**Category:** General Discussion\
**Created:** [July 18, 2016, 8:51pm UTC](https://forum.inductiveautomation.com/t/sqlquery-tags-in-udt/11944 "2016-07-18T20:51:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ase\_aust](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@ase\_aust](https://forum.inductiveautomation.com/u/ase_aust)\
**Post date:** [July 18, 2016, 8:51pm UTC](https://forum.inductiveautomation.com/t/sqlquery-tags-in-udt/11944/1 "2016-07-18T20:51:58Z")

</div>

I have created a udt where each member is a separate sqlquery tag. This seemed chatty so I combined them into one sqlquery tag with a datatype of dataset which worked well. Now, I need to trend and alarm on each of the columns in the dataset. I tried creating a new memory tag for each column and referencing the dataset within the udt. I couldn’t seem to get that to work. I then tried a value changed script on the sqlquery tag with the aim of writing directly to the other members of the udt.

Is this the right approach or am I way off? If so, what is the syntax to resolve the row/column in the dataset. Note, there will only be 1 row in the dataset.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [July 20, 2016, 12:07am UTC](https://forum.inductiveautomation.com/t/sqlquery-tags-in-udt/11944/2 "2016-07-20T00:07:02Z")

</div>

Hi! Welcome to the forums!

Try an expression tag. From the manual:

```auto
Dataset_Name["Column_Name"] //returns the value from the first row at the given column name
Dataset_Name[Column_Index] //returns the value from the given column at the first row
Dataset_Name[Row_Index, "Column_Name"] //returns the value from the given row at the given column name
Dataset_Name[Row_Index, Column_Index] //returns the value from the given row at the given column index
```

OT EDIT: Hey! 1500 posts! 😃
