Listing all Data Sources and their Dependencies (reports, items, etc) in SQL Server 2008 R2

后端 未结 3 2085
挽巷
挽巷 2020-12-05 06:55

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.

I am looking to generate a report (or list) of al

3条回答
  •  伪装坚强ぢ
    2020-12-05 07:50

    This query should be run against the ReportServer database

    SELECT
        DS.Name AS DatasourceName,
        C.Name AS DependentItemName, 
        C.Path AS DependentItemPath
    FROM
        ReportServer.dbo.Catalog AS C 
            INNER JOIN
        ReportServer.dbo.Users AS CU
            ON C.CreatedByID = CU.UserID
            INNER JOIN
        ReportServer.dbo.Users AS MU
            ON C.ModifiedByID = MU.UserID
            LEFT OUTER JOIN
        ReportServer.dbo.SecData AS SD
            ON C.PolicyID = SD.PolicyID AND SD.AuthType = 1
            INNER JOIN
        ReportServer.dbo.DataSource AS DS
            ON C.ItemID = DS.ItemID
    WHERE
        DS.Name IS NOT NULL
    ORDER BY
        DS.Name;
    

    The dependent items page in Report Manager executes the dbo.FindItemsByDataSource stored procedure, supplying these parameters: ItemID = and AuthType = 1. The above query is a hacked version of the query used by this stored procedure to remove the data source specific ID. This allows dependent items to be returned for all data sources. I removed the data sources themselves from the results with DS.Name IS NOT NULL

提交回复
热议问题