0

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.

4

1 回答 1

0

为什么不只搜索Path列中的特定文件夹?

declare @folder varchar(256) = 'Demo'

select Name
from Catalog
where Path + '/' = '/' + @folder + '/'

通过添加/Path变量,您可以消除部分匹配。

在文件夹结构中有多个同名文件夹的情况下可能并不完美,但任何方法都会有类似的问题需要克服。

于 2013-10-29T14:05:36.513 回答