SQL Query Tag Issue

So I’m trying to execute a stored procedure in a query tag but it does not work and just returns a null value. The query should return only a single number. For some reason I am able to execute the stored procedure if I bind it to a property value such as a PV for a analog indicator but does not work for Query Tags. I’m also able to run a basic select statement through a query tag but cannot get it to execute a stored procedure. Is there any reason why I am unable to execute a stored procedure from a SQL Query Tag or what could I be possibly missing?

Thanks,

I’m running into the same issue at the moment. I see you didn’t get any replies on the forum, were you able to figure it out for yourself? Thanks!

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:

execute QueryTagResult 2,3

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

Thanks for your reply! I was sure I had tried that before, but it is working now. Have a great weekend!