Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

Data Management

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Your profile

    Search

    XML Feeds

    Google Ads

    « T-SQL Tuesday #13: What the Business Says Is Not What the Business WantsDealing with The row value(s) updated or deleted either do not make the row unique or they alter multiple rows errors »
    comments

    As we all know SQL Server Reporting Services is a very powerful tool that gives end users a multitude of ways to retrieve data. One such way is through subscriptions. Subscriptions can be created by both Administrators and end users. So as an administrator it is difficult to keep track of what subscriptions are running and when they are running. It can also come as a surprise when the Director of a department comes to you to ask where his report was this morning. As a DBA we must always know before the end user when there is a problem. So how can we know if subscriptions are running successfully? There is actually a very simple query. When a subscription is created a record is added to the dbo.Subscriptions table in the ReportServer database. There is also column in that table named LastStatus. That column is update with the LastStatus of each subscription after the subscription is executed. I have written a query that selects records where the LastStatus was not successful. The path field in the query will show you where you find the report. This way you can go in to correct the subscription if the problem is with the email recipient.

    1. select s.LastRunTime,
    2.        s.LastStatus,
    3.        s.Description,
    4.        c.Path,
    5.        c.name,
    6.        u.UserName as SubscriptionOwner
    7. from subscriptions s
    8. JOIN users u on s.OwnerId = u.UserId
    9. JOIN Catalog c on s.Report_OID = c.ItemID
    10. WHERE LastStatus like '%Failure%'
    11. Or LastStatus like '%Error%'
    12. or LastStatus like '%The e-mail address of one or more recipients is not valid.%'
    13. or LastStatus like '%Thread was being aborted.%'
    14. Order by LastRunTime

    I have not been able to find a list of distinct or possible LastStatus values. That is why I use key words like Failure or error. If any knows of that list feel free to add a comment on where to find it.
    I have also taken this query and made a report that can be run from SSRS. I have granted permissions on the report to our Helpdesk. This allows them to run it as part of their morning processes. They can then be proactive in trouble shooting failed report subscriptions.
    One other note about subscriptions, most end users who create their own subscriptions schedule them to run just before they come in for the day. So you will find that most subscriptions are running first thing in the morning. You may choose to monitor this and ask end users to run spread them out over larger time period to balance the load.

    About the Author

    Paul is a SR DBA and one of the Co-Founders of LessThanDot. Paul has over 12 years experience in RDBMS for Financial and Manufacturing companies and experienced with AS400, DB2, Oracle, Sybase and SQL Server. Currently living in the Newport, Rhode Island area with his wife and 5 children Paul dedicates his spare time to his family and coaching Little League and serving as the President of Middletown Little League Board of Directors.
    Social SitingsTwitterLinkedInLTD RSS Feed
    1345 views
    Instapaper

    No feedback yet

    Leave a comment


    Your email address will not be revealed on this site.

    Your URL will be displayed.
    (Line breaks become <br />)
    (Name, email & website)
    (Allow users to contact you through a message form (your email will not be revealed.)