【发布时间】:2019-10-09 16:31:35
【问题描述】:
我尝试通过 SQL 访问以下 XML 的 DisplayName - 文本。使用 -SDMPackageDigest.value('(/DesiredConfigurationDigest/SoftwareUpdateBundle/Annotation/DisplayName/@Text)[1]', 'varchar(MAX)') as 'Display Name' - 只返回一个 NULL 值。这哪里错了?
<DesiredConfigurationDigest xmlns="http://schemas.microsoft.com/SystemsCenterConfigurationManager/2009/07/10/DesiredConfiguration">
<SoftwareUpdateBundle AuthoringScopeId="Site_54F0FA43-F0DC-403D-A5AF-4B54F58C1160" LogicalName="SUM_41a6b6d6-6976-49b5-a4c4-0121dc96189c" Version="200">
<Annotation xmlns="http://schemas.microsoft.com/SystemsCenterConfigurationManager/2009/06/14/Rules">
<DisplayName Text="2019-05 Servicing Stack Update for Windows 10 Version 1903 for x86-based Systems (KB4498523)" />
<Description Text="Install this update to resolve issues in Windows. For a complete listing of the issues that are included in this update, see the associated Microsoft Knowledge Base article for more information. After you install this item, you may have to restart your computer." />
</Annotation>
<ConfigurationMetadata SmsUniqueIdentity="41a6b6d6-6976-49b5-a4c4-0121dc96189c" Version="200">
<Provider SourceType="default">
<Operation Name="Detect">
<Parameter Name="ScanTool">
<Property Name="ScanToolId" Value="{54F0FA43-F0DC-403D-A5AF-4B54F58C1160}" />
<Property Name="MinCatalogVersion" Value="1" />
</Parameter>
</Operation>
<Operation Name="Install">
<Parameter Name="CommandLine">
<Property Name="CommandLine" Value="/WUSInstaller /UpdateID:41a6b6d6-6976-49b5-a4c4-0121dc96189c" />
</Parameter>
<Parameter Name="RequiresExclusiveHandling">
<Property Name="RequiresExclusiveHandling" Value="True" />
</Parameter>
</Operation>
</Provider>
</ConfigurationMetadata>
<SupersededUpdates>
<SoftwareUpdateReference AuthoringScopeId="Site_54F0FA43-F0DC-403D-A5AF-4B54F58C1160" LogicalName="SUM_41325597-7968-4eeb-8113-6411cbbe8c90" />
</SupersededUpdates>
<Updates>
<SoftwareUpdateReference AuthoringScopeId="Site_54F0FA43-F0DC-403D-A5AF-4B54F58C1160" LogicalName="SUM_775e479e-a5ca-4530-9c06-edfd298c824a" />
</Updates>
</SoftwareUpdateBundle>
</DesiredConfigurationDigest>
【问题讨论】:
标签: sql sql-server xml tsql