# SQL Query Tag Issue

**URL:** <https://forum.inductiveautomation.com/t/sql-query-tag-issue/10345>\
**Category:** Ignition\
**Created:** [August 14, 2015, 2:16pm UTC](https://forum.inductiveautomation.com/t/sql-query-tag-issue/10345 "2015-08-14T14:16:39Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Kraenbring](https://avatars.discourse-cdn.com/v4/letter/k/f4b2a3/32.png) [@Kraenbring](https://forum.inductiveautomation.com/u/Kraenbring)\
**Post date:** [February 12, 2016, 1:47pm UTC](https://forum.inductiveautomation.com/t/sql-query-tag-issue/10345/3 "2016-02-12T13:47:02Z")

</div>

Check to make sure you have this line at the beginning of the stored procedure:  
SET NOCOUNT ON;

Otherwise it returns two datasets, the first being a count of records affected, the second being your actual data. Here’s a sp i just created to test:

[code]CREATE PROCEDURE QueryTagResult  
@x int  
,@y int

AS  
BEGIN  
SET NOCOUNT ON;

```
select @x + @y as 'value'

```

END  
GO[/code]

And for my SQL Query Tag, I have this as my statement:

```auto
execute QueryTagResult 2,3
```

Make sure the Query Type is set to “Select”  
Hope that helps!

---

_[View the full topic](https://forum.inductiveautomation.com/t/sql-query-tag-issue/10345)._
