Created
February 21, 2018 22:16
-
-
Save lotsahelp/3d1a0e0bc1c903e748c8db6e59ebc046 to your computer and use it in GitHub Desktop.
Forces SSRS catalog to update report definition based on report content.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE ReportServer; | |
WITH XMLNAMESPACES | |
( | |
'http://schemas.microsoft.com/SQLServer/reporting/reportdesigner' AS rd, | |
DEFAULT 'http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition' | |
) | |
--SELECT Report.value('(.)[1]', 'nvarchar(512)') | |
UPDATE c | |
SET c.Description = Report.value('(.)[1]', 'nvarchar(512)') | |
FROM dbo.Catalog AS c | |
CROSS APPLY ( | |
SELECT CONVERT(xml, CONVERT(varbinary(MAX), Content)) AS ContentXml | |
) AS ca | |
CROSS APPLY ca.ContentXml.nodes('/Report/Description') AS T2(Report) | |
WHERE Path LIKE N'/%' | |
AND c.Description <> Report.value('(.)[1]', 'nvarchar(512)'); | |
WITH XMLNAMESPACES | |
( | |
'http://schemas.microsoft.com/SQLServer/reporting/reportdesigner' AS rd, | |
'http://schemas.microsoft.com/sqlserver/reporting/2010/01/componentdefinition' AS cl, | |
DEFAULT 'http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition' | |
) | |
--SELECT Report.value('(.)[1]', 'nvarchar(512)') | |
UPDATE c | |
SET c.Description = Report.value('(.)[1]', 'nvarchar(512)') | |
FROM dbo.Catalog AS c | |
CROSS APPLY ( | |
SELECT CONVERT(xml, CONVERT(varbinary(MAX), Content)) AS ContentXml | |
) AS ca | |
CROSS APPLY ca.ContentXml.nodes('/Report/Description') AS T2(Report) | |
WHERE Path LIKE N'/%' | |
AND c.Description <> Report.value('(.)[1]', 'nvarchar(512)'); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for publishing this script. It helped me!