我刚开始在 SQL Server 数据库中查询 XML。我在最基本的查询方面遇到了麻烦。这是一个简化的例子。如何返回描述?下面的 SELECT 语句是我正在使用的,但它什么也不返回。
SELECT Incidents.IncidentXML.query
('data(/dsIncident/IncidentInformation/Description)') AS Description
FROM Incidents
这是我正在使用的 XML 文件的片段:
<dsIncident xmlns="http://tempuri.org/dsIncident.xsd">
<IncidentInformation>
<Description>This is the description.</Description>
<Country>Singapore</Country>
</IncidentInformation>
</dsIncident>