Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kristinaconley/5671319 to your computer and use it in GitHub Desktop.
Save kristinaconley/5671319 to your computer and use it in GitHub Desktop.
USE ReportServer
/*Data Sources used in Reports*/
SELECT
S.name AS 'Report Name'
,C.Name AS 'DataSource'
FROM dbo.[Catalog] S (NOLOCK)
INNER JOIN DataSource DS (NOLOCK) ON (s.ItemID = DS.ItemID)
INNER JOIN dbo.[Catalog] C (NOLOCK) ON (DS.Link = C.ItemID)
WHERE
S.Type = 2 --Type 2 is Report
ORDER BY 1
/*Data Sources used in Subscriptions*/
SELECT
C.name
,S.Description
,C1.Name datasource
FROM dbo.Subscriptions S (NOLOCK)
INNER JOIN DataSource DS (NOLOCK) ON (S.SubscriptionID = DS.SubscriptionID)
INNER JOIN Catalog C1 (NOLOCK) ON (DS.Link = C1.ItemID)
INNER JOIN dbo.Catalog C (NOLOCK) ON (C.ItemID = S.Report_OID)
WHERE
C.Type = 2 --Type 2 is Report
ORDER BY 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment