[solved] Execute Stored Procedure (with no Fields)

  • Hi Guys,

    I'm searching for a while now, but can't find a solution.

    We have a ssrs project where we are using Reports for Dashboarding. To do Right Management, we have a function for each table, these functions has a so called "Token" wich represents a specific user. As these Tokens have a timeout, there is function called "ExpandToken" which is expanding the timeout.

    My Idea is to call these Function as a Dataset with every Dashboard (Report) to have a fresh Timeout with every new opened Dashboard.

    And here is my problem: I can’t execute these Function. I've tried to make a Dataset just with "EXEC DBO.ExpandToken @CurrentToken" in it, these seems not to work.

    Then I tried to run it as "Procedure" but these seems not to work either.

    I'm kind of desperate and really hope you guys have any Ideas!

    Many thanks in Advanced, Mirko

    • This topic was modified 3 years, 3 months ago by  MirkoDC.
  • I can't see any reason why it wouldn't work as long as @CurrentToken is defined.  I've run stored procedures inside an SSRS report.  I think it needs to return a data set, so after your stored procedure call, do something like:

    SELECT 1 AS [Complete]

    so you have a data set IF the stored procedure call gives no data set AND you have no more data sets coming back in the rest of that query.

    BUT to add to what I have above, what error are you getting?  Knowing the error will definitely help in solving the problem.  My GUESS is that it is not returning a data set, but I could be completely wrong.

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Hi Brian,

    that whas it!

    Adding any Field-Result solved the issue, now my function is running as expected!

    Best wishes, Mirko

     

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

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