0
다음 코드의 xmlns 특성으로 필요한 값을 얻을 수 없습니다. xmlns가 아닌 다른 속성과 잘 작동합니다. 나는 주어진 xml에 대한 제어권이 없다 - 어떻게 CrpId 값을 얻을 수 있는가?요소에 xmlns 특성이있는 경우 openxml에서 값을 가져올 수 없습니다.
declare @CrpId int, @i int, @xml xml
set @xml =
'<NewProgressReportResult xmlns="http://myDomain.com/crp">
<CrpId>2160</CrpId>
</NewProgressReportResult>'
exec sp_xml_preparedocument @i output, @xml
select
CrpId
from openxml (@i, 'NewProgressReportResult', 2)
with (
CrpId int 'CrpId'
)
exec sp_xml_removedocument @i