declare @_xml xml; set @_xml = N'<?xml version="1.0"?> <Contract xmlns="urn:UralsibinsNamespace" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <NS1:RDIntegrationPolicy xmlns:NS1="http://tempuri.org/UralSib/HTSoap"> <RecordNumber xmlns="">0</RecordNumber> <ProductName xmlns="">Тестовое решение</ProductName> <PolicySerial xmlns="">ТЕСТ</PolicySerial> <PolicyNumber xmlns="">1800007909</PolicyNumber> <PolicyStatus xmlns="">Акцептован</PolicyStatus> <PolicyInsCurrency xmlns="">рубли</PolicyInsCurrency> <PolicyEffectiveDate xmlns="">2016-08-10T00:00:00</PolicyEffectiveDate> <PolicyExpirationDate xmlns="">2031-08-10T00:00:00</PolicyExpirationDate> <PolicyPeriod xmlns="">0</PolicyPeriod> <IsSuccessor xmlns="">false</IsSuccessor> <Errors xmlns=""> <string>Ошибка извлечения информации по полису: Input string was not in a correct format.</string> </Errors> </NS1:RDIntegrationPolicy> </Contract> '; print convert( nvarchar(max), @_xml); select tbl.policy.value( 'RecordNumber[1]', 'int') as record_number, tbl.policy.value( 'ProductName[1]', 'varchar(100)') as product_name from @_xml.nodes( 'Contract/RDIntegrationPolicy') as tbl( policy) ;
Коллеги, вот это не возвращает resultset, не понимаю почему. Подскажите, пожалуйста.