Mydbr admin reports

(2 posts) (2 voices)

Tags:

  1. -nth-, Member

    I was just checking out the built in admin reports and trying to find a way to see exactly what reports a specific user has run. It doesn't appear that there's functionality in the existing "Statistics Summary" report to do that. However in looking at that report's code it contains the following lines:

    /* Not included in the distribution */ select 'dbr.report', 'sp_DBR_userusage', 'popup', 2, 'inUser=4', 'inStartDate=-2', 'inEndDate=-3';

    So is there any way to get that stored procedure? It looks like it fits exactly what I'd like to see.

    Thanks,
    -nth-

    PS - I know I could build my own, but using an existing one would be much quicker! :)

  2. myDBR Team, Key Master

    Sure,
    feel free to make it your own.

    if object_id('sp_DBR_userusage','P') is not null
    DROP PROCEDURE sp_DBR_userusage
    go
    create procedure sp_DBR_userusage
    @inUser nvarchar(128),
    @inStartDate datetime,
    @inEndDate datetime
    as
    begin
    declare @vEndTime datetime select @vEndTime = dbo.fn_EndOfDay(@inEndDate) select 'dbr.title', u.name
    from mydbr_userlogin u
    where u.username= @inUser select 'dbr.sum', 2 select r.name as 'Report',
    count(*) as 'Run count'
    from mydbr_statistics s, mydbr_reports r
    where s.start_time between @inStartDate and @vEndTime and username=@inUser and s.proc_name=r.proc_name
    group by r.name
    order by 2 desc; end
    go

    --
    myDBR Team


Reply

You must log in to post.