I would like to generate a list of all of the reports located in a folder in the ReportServer
database from the [dbo].[Catalog]
table.
I would like to include any report that may be listed in any child folders as well.
-Root
-Report: Three
-Folder: Demo
+ Report: One
- SubFolder: Sample
+ Report: Two
In this Example if I selected all reports from Folder: Demo
I would get back Report: One
and Report: Two
only.
Why not just search for that particular folder in the Path
column?
declare @folder varchar(256) = 'Demo'
select Name
from Catalog
where Path + '/' = '/' + @folder + '/'
By adding / to Path
and the variable you eliminate partial matches.
It might not be perfect where there are multiple folders with the same names in the folder structure but any method will have similar issues to overcome.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.