sql Zeigt den Pfad zu einem Package von dem die ID bekannt sein muss。
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql Zeigt den Pfad zu einem Package von dem die ID bekannt sein muss。相关的知识,希望对你有一定的参考价值。
DECLARE @Path AS varchar(2000) DECLARE @ObjectType AS int DECLARE @PackageID AS varchar(8)
SET @PackageID = 'D010289F' ;
WITH folCTE (ROW, ContainerNodeID, Name, parentContainerNodeID,ObjectType) AS
( SELECT 1 ,
ContainerNodeID ,
Name ,
parentContainerNodeID ,
ObjectType
FROM dbo.Folders
WHERE (ContainerNodeID IN
(SELECT ContainerNodeID
FROM dbo.FolderMembers
WHERE InstanceKey = @PackageID))
AND (ObjectType NOT IN (7,
8))
UNION ALL SELECT cte.ROW + 1 ,
f.ContainerNodeID ,
f.Name ,
f.parentContainerNodeID ,
f.ObjectType
FROM dbo.Folders f
INNER JOIN folCTE cte ON cte.parentContainerNodeID = f.ContainerNodeID)
SELECT @Path = COALESCE(@Path + '\', '') + Name from folCTE ORDER BY row DESC
SELECT @ObjectType = ObjectType FROM dbo.Folders WHERE ContainerNodeID IN (SELECT ContainerNodeID FROM dbo.FolderMembers WHERE InstanceKey = @PackageID) AND (ObjectType NOT IN (7,8))
SELECT
@PackageID AS 'PackageID'
,pkg.Manufacturer + ' ' + pkg.Name + ' ' + pkg.Version AS 'Package'
,CASE
WHEN @ObjectType = 2 THEN 'Software Distribution\Packages\' + @Path
WHEN @ObjectType = 14 THEN 'Operating SYSTEM Deployment\Operating SYSTEM Install Packages\' + @Path
WHEN @ObjectType = 18 THEN 'Operating SYSTEM Deployment\Operating SYSTEM Images\' + @Path
WHEN @ObjectType = 19 THEN 'Operating SYSTEM Deployment\Boot Images\' + @Path
WHEN @ObjectType = 20 THEN 'Operating SYSTEM Deployment\Task Sequences\' + @Path
WHEN @ObjectType = 23 THEN 'Operating SYSTEM Deployment\Driver Packages\' + @Path
WHEN @ObjectType = 25 THEN 'Operating SYSTEM Deployment\Drivers\' + @Path
ELSE @Path
END AS 'Path'
FROM v_Package pkg
WHERE PackageID = @PackageID
以上是关于sql Zeigt den Pfad zu einem Package von dem die ID bekannt sein muss。的主要内容,如果未能解决你的问题,请参考以下文章