TODO: add pictures so people have an idea of what it would look like
;
WITH FOLDER_STRUCTURE AS
(
SELECT
F.folderid
, cast('MSDB/' as nvarchar(max)) As folder_path
FROM
msdb.dbo.sysdtspackagefolders90 F
WHERE
folderid = '00000000-0000-0000-0000-000000000000'
UNION ALL
SELECT
F.folderid
, R.folder_path + F.foldername + '/' As folder_path
FROM
FOLDER_STRUCTURE R
INNER JOIN
msdb.dbo.sysdtspackagefolders90 F
ON F.parentfolderid = R.folderid
)
, PACKAGES AS
(
SELECT
P.name AS package_name
, P.folderid
, P.id as package_id
, P.createdate as package_createdate
, P.vermajor
, P.verminor
, P.verbuild
FROM
msdb.dbo.sysdtspackages90 P
)
SELECT
FS.folder_path + P.package_name
FROM
PACKAGES P
INNER JOIN
FOLDER_STRUCTURE FS
ON FS.folderid = p.folderid
No comments:
Post a Comment