Vous êtes ici :
Bien souvent, SSRS a été installé et n’est pas utilisé. Cette requête visite la base ReportServer pour voir s’il existe un contenu.
Exists SSRS reports ?
Transact-SQL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
DECLARE @n sysname DECLARE @sql NVARCHAR(MAX) SELECT @n=name FROM sys.databases WHERE name LIKE 'ReportServer%' AND name NOT LIKE '%TempDB%' SET @sql = N'SELECT @@SERVERNAME as ServerName,'''+@n+''' as ReportServerDB,Path,Name, CASE WHEN C.type = 1 THEN ''1-Folder'' WHEN C.type = 2 THEN ''2-Report'' WHEN C.type = 3 THEN ''3-File'' WHEN C.type = 4 THEN ''4-Linked Report'' WHEN C.type = 5 THEN ''5-Datasource'' WHEN C.type = 6 THEN ''6-Model'' WHEN C.type = 7 Then ''7-ReportPart'' WHEN C.type = 8 Then ''8-Shared Dataset'' ELSE ''9-Unknown'' END AS ItemType FROM '+QUOTENAME(@n)+'..Catalog C' EXEC (@sql) |
Table of Contents