Displaying variable in store procedure

  • Is there a way to display the value of a variable in a stored procedure that is the dataset of a report?

  • Unless i dont understand the question, can you just add the variable you want to see in the output of the stored proc ?

    eg


    select col1, col2, col3, @var1, @var2
    from table1

  • I am sure your way will work Matak but if the result set (of the SP) is huge, it would be inefficient to return thousands of rows with extra variable columns back.

    I was trying to assign the variable back to an output variable of the SP but that show up blank in the SSRS report.  

    BabyAqua want to thank you.  Do you have any other method?  I am sure this has been done before.

  • Could you put these in a separate stored procedure?  If so, you could setup a parameter in the report, have the Available values and Default values defined as "Get values from a query".  Then you'd only get them back once, and you could do whatever you needed with the values.
    If I've misunderstood what you were going to use the values for, maybe they could just be a separate Dataset?

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply