Add the script below to the file:
In 2008R2
...\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportManager\Pages\Report.aspx
In 2012
...\Program Files\Microsoft SQL Server\MSRS12.MSSQLSERVER\Reporting Services\ReportManager\Pages\Report.aspx
This is my collection of mostly useful SQL server information that helps administer the server. It is mostly aimed at SQL Server 2012 / 2014 / 2016.
Showing posts with label reporting services. Show all posts
Showing posts with label reporting services. Show all posts
Wednesday, April 13, 2016
Monday, August 9, 2010
Reporting Services and xml
I am currently struggling to create method of scheduling Reporting service subscriptions without having that stupid GUID as the job name. First I needed to learn more about querying the dubiously formatted Reporting services xml.
USE [ReportServer];
/****** Script for SelectTopNRows command from SSMS ******/
WITH cteSubs (SubscriptionId, Params) AS
(
SELECT
SubscriptionID
, CAST(CAST([ExtensionSettings] AS NVARCHAR(max)) AS XML) AS params
FROM [dbo].[Subscriptions] subs
INNER JOIN [dbo].[Schedule] sch
ON subs.SubscriptionID = sch.[EventData]
)
SELECT
SubscriptionID
,(SELECT nref.value('Value[1]', 'nvarchar(50)') Comment FROM Params.nodes('/ParameterValues/ParameterValue') AS R(nref) WHERE nref.exist('.[Name = "Comment"]') = 1) AS Comment
FROM cteSubs
This extracts the value of the comment so I can use it for the Job Name later
USE [ReportServer];
/****** Script for SelectTopNRows command from SSMS ******/
WITH cteSubs (SubscriptionId, Params) AS
(
SELECT
SubscriptionID
, CAST(CAST([ExtensionSettings] AS NVARCHAR(max)) AS XML) AS params
FROM [dbo].[Subscriptions] subs
INNER JOIN [dbo].[Schedule] sch
ON subs.SubscriptionID = sch.[EventData]
)
SELECT
SubscriptionID
,(SELECT nref.value('Value[1]', 'nvarchar(50)') Comment FROM Params.nodes('/ParameterValues/ParameterValue') AS R(nref) WHERE nref.exist('.[Name = "Comment"]') = 1) AS Comment
FROM cteSubs
This extracts the value of the comment so I can use it for the Job Name later
Subscribe to:
Posts (Atom)