列出 SQL Server 2008 R2 中的所有数据源及其依赖项(报告、项目等) [英] Listing all Data Sources and their Dependencies (reports, items, etc) in SQL Server 2008 R2
问题描述
我是 SQL Server 的新手,如果我的问题有明显的解决方案,我很抱歉,但我似乎找不到.
I am new to SQL Server, and I am sorry if there is an obvious solution to my question but I can't seem to find it.
我希望在 SQL Server 2008 R2(报告服务器)上生成所有数据源及其各自依赖项的报告(或列表).
I am looking to generate a report (or list) of all the data sources and their individual dependencies on an SQL Server 2008 R2 (reporting server).
我知道我可以访问每个单独的数据源以获取依赖于它的所有项目的列表.我过去做过这个,但很费时间.
I know that I can access each individual data source to get a list of all the items that are dependent on it. I have done this in the past but it is time consuming.
有没有办法获得一份报告,显示所有数据源及其依赖项?
Is there a way to get a report that would display all the data sources and their dependent items?
提前致谢,
马万
推荐答案
以下内容(根据 beargle 之前发布的内容进行了修改)满足了我的要求.这将按实际名称列出所有数据源及其所有依赖项:
The following (which was modified from what beargle posted earlier) does what I was looking for. This will list all the data sources by their actual name, and all their dependent items:
SELECT
C2.Name AS Data_Source_Name,
C.Name AS Dependent_Item_Name,
C.Path AS Dependent_Item_Path
FROM
ReportServer.dbo.DataSource AS DS
INNER JOIN
ReportServer.dbo.Catalog AS C
ON
DS.ItemID = C.ItemID
AND
DS.Link IN (SELECT ItemID FROM ReportServer.dbo.Catalog
WHERE Type = 5) --Type 5 identifies data sources
FULL OUTER JOIN
ReportServer.dbo.Catalog C2
ON
DS.Link = C2.ItemID
WHERE
C2.Type = 5
ORDER BY
C2.Name ASC,
C.Name ASC;
这篇关于列出 SQL Server 2008 R2 中的所有数据源及其依赖项(报告、项目等)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!