locked
Setting up a Stored Procedure to records SSRS report run times RRS feed

  • Question

  • Hi all,

    I have a Database called CommDB. Is it possible to set up a Stored Procedure (new to these so unsure how at this time) to be able to log when my SSRS reports are run. I was thinking just a table with a couple of columns with the report name and a datetime stamp. I would then add this code to the SQL in the reports so it fires when the report is run.

    Friday, July 8, 2016 6:40 AM

Answers

All replies

  • Hello Simon,

    There is already a build-in logging in SSRS, you can query it with

    SELECT TOP 1000 *
      FROM [ReportServer].[dbo].[ExecutionLog3]
      ORDER BY [TimeEnd] DESC


    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    • Proposed as answer by disssss Sunday, July 10, 2016 8:35 PM
    Friday, July 8, 2016 7:11 AM
  • Hello Simon,

    There is already a build-in logging in SSRS, you can query it with

    SELECT TOP 1000 *
      FROM [ReportServer].[dbo].[ExecutionLog3]
      ORDER BY [TimeEnd] DESC


    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Hi, thanks for this, as an analyst Im not sure we have access to these. So for arguments sake I'm doing this also for personal development in writing a Stored Procedure to record an action when a report is run. I'm assuming this is possible if I create a table and then something to update that table when a report is run (provided I add the code to each report).
    Friday, July 8, 2016 7:36 AM
  • Hi, You can create sp for reports datasets instead query and do anything you want.


    MS SQL

    Friday, July 8, 2016 9:00 AM
  • Don't reinvent the wheel here.  Olaf's example is exactly what you need it sounds like.
    • Edited by ddwildnd Friday, July 8, 2016 9:10 PM spelling error
    Friday, July 8, 2016 9:10 PM
  • Ok forget SSRS, I'll have to add another question that excludes SSRS altogether. I don't have access to the report Server so can't query it. So my question still remains
    Monday, July 11, 2016 8:02 AM
  • Then add the logging to your stored procedures or in the reports.

    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Monday, July 11, 2016 10:22 AM