Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从xml变量sql获取值_Sql_Xml_Xsd_Sqlxml - Fatal编程技术网

从xml变量sql获取值

从xml变量sql获取值,sql,xml,xsd,sqlxml,Sql,Xml,Xsd,Sqlxml,您好,我正在使用SQL,并且在变量中有以下值 <needs xsi:noNamespaceSchemaLocation="../../../../docs/xsd/rx/i2.0/needs-i2.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Method qid="String" isApplicable="true" location="needs" source

您好,我正在使用SQL,并且在变量中有以下值

<needs xsi:noNamespaceSchemaLocation="../../../../docs/xsd/rx/i2.0/needs-i2.0.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Method qid="String" isApplicable="true" location="needs"
        source="needs">
        <Yes>false</Yes>
        <No>true</No>
    </Method>
    <S_Needs qid="String" isApplicable="true" location="needs"
        source="needs">
        <N_Value type="String" id="String" from="String"> NEED THIS VALUE </N_Value>
    </S_Needs>
    <Testing qid="String" isApplicable="true" location="needs"
        source="needs">
        <Yes>false</Yes>
        <No>false</No>
        <Defaults>true</Defaults>
    </Testing>
</needs>

假的
真的
需要这个值吗
假的
假的
真的
路线是需要,S_需要,N_值我需要N_值我怎么能得到这个值

select @XML.value('(/needs/S_Needs/N_Value/text())[1]', 'nvarchar(max)')