日期:2014-05-18  浏览次数:20919 次

在SQL2005时的XML字段里怎么查询是否包含某个字符串?
如:
一个XML字段的值为:
<root>
  <Text> 中国人民解放军 </Text>
  <Text> 中国人民 </Text>
  <Text> 人民解放军 </Text>
  <Text> 解放军 </Text>
  <Text> 中国 </Text>
</root>

我想知道这个字段的 "/root/Text "的值里是否包含: "中国人民 "这个字符串,应该怎么做?


------解决方案--------------------
用 contains 函数, 或者解析出来判断