Sample Header Ad - 728x90

How to query EndDate value from ReportServer..Subscriptions.MatchData

4 votes
1 answer
2197 views
In SQL 2008 R2, I'm putting together some administrative queries on SSRS metadata to check proper configuration, and other sorts of proactive things. While querying the ReportServer db, I've been successful in checking reports, shared data sources, etc. The *one* thing that I am having trouble with is querying for any value within the Subscriptions.MatchData column. Everything from this column comes back as NULL (unless I return the entire contents of the column). Specifically, I need the value for EndDate. I've tried a number of tweaks to no avail, including toying around with XPath, XMLNamespace, etc. I found this basic example of how it is supposed to work in 2005. What is different about 2008 that this will not work? And how can I query this value in 2008 R2? ` SELECT [Description] ,x.m.value('StartDateTime','varchar(30)') AS StartDateTime ,x.m.value('EndDate','varchar(10)') AS EndDate FROM ( SELECT [description] ,CAST(MatchData AS XML) AS MatchData FROM ReportServer.dbo.Subscriptions ) AS P CROSS APPLY MatchData.nodes('//ScheduleDefinition') x(m) `
Asked by dev_etter (762 rep)
Mar 13, 2012, 08:04 PM
Last activity: Oct 7, 2016, 03:16 PM