XLCubed to which Cube or Database is a report connecting?

We are planning a major overhaul on one of our cubes.
The problem is that we don't know which reports are connection to this cube.
We have over twohunderd possible candidates and don't want to open each one to check.
I wrote a simple query to extract the connections from the repository:

SELECT
DISTINCT
  fp.cPath as ReportPath
, r.[cName] as ReportName
, case when
CHARINDEX('<connections>',convert(varchar(max),f.oData)) > 0
THEN
SUBSTRING(convert(varchar(max),f.oData),
CHARINDEX('<connections>',convert(varchar(max),f.oData)),
CHARINDEX('</connections>',convert(varchar(max),f.oData))
- CHARINDEX('<connections>',convert(varchar(max),f.oData))+14) END
as CubeConnections
, case when
CHARINDEX('<sqlconnections>',convert(varchar(max),f.oData)) >0
THEN
SUBSTRING(convert(varchar(max),f.oData),
CHARINDEX('<sqlconnections>',convert(varchar(max),f.oData)),
CHARINDEX('</sqlconnections>',convert(varchar(max),f.oData))
- CHARINDEX('<sqlconnections>',convert(varchar(max),f.oData))+17) END
as SQLConnections
FROM [XLCubedWeb].[dbo].[XL3Reports] r
inner join [XLCubedWeb].[dbo].[XL3ReportFiles] rf
on r.nReportId = rf.nReportID
inner join [XLCubedWeb].[dbo].[XL3File] f
on  rf.nFileId = f.nFileID
inner join [XLCubedWeb].[dbo].[XL3FoldersWithPath] fp
on r.nFolderId = fp.nFolderID
inner join (SELECT [nReportID]
,MAX([nRevision]) as [nRevision]
FROM [XLCubedWeb].[dbo].[XL3ReportRevisions]
GROUP BY [nReportID]) rr /*We only want 'active' reports*/
on rf.[nReportID] =rr.[nReportID]
where f.cName = 'workbook.xl3xml'



From this base you can look for the report which connect to specified cube.


Till Next Time

Comments

Popular posts from this blog

XLCubed Show Hide Columns with button

XLCubed XL3ExecuteSQLProc error