Reports and SSRS - Get List of Report Folders

Applicability:

                 SQL Server 2000:        Not Tested
                 SQL Server 2005:        Tested
                 SQL Server 2008:        Tested
                 SQL Server 2008R2:    Tested
                 SQL Server 2012:        Not Tested        

Credits:

Author:    ChillyDBA
Date:        25 Jul 2012

Description

SP to retrieve a list of report folders from the Report Server Database Catalog table.

NOTE:  It is assumed that the Report Server Database has its default name of 'ReportServer'
 

Code

Stored Procedure:


DROP PROC usp_GetSSRSFolderList
GO

CREATE PROC usp_GetSSRSFolderList
AS

/****************************************************
Purpose:   To retreive a list of report server folders.
           Uses the Catalog table in the report server
           database (assumed to be called by its default
           name of 'ReportServer')

Author:        ChillyDBA
History:   25 Jul 2012
*****************************************************/

SELECT
  
cat.TYPE,
  
cat.Name,  
  
cat.Path  
FROM  ReportServer..Catalog AS cat (NOLOCK)
WHERE TYPE = 1 --folders only
AND ISNULL(cat.Name, '') <> ''
ORDER BY path  
  

ċ
usp_GetSSRSFolderList.sql
(1k)
Andy Hughes,
Jul 25, 2012, 7:59 AM
Comments