在 SQL 2008 的 where 子句中使用 XML 列
我有一个存储过程,其中需要有一个 where 子句,其内容类似于:
where XMLDataPoint <> NULL
但是,XMLDataPoint 是一个 XML 列,我收到错误
“XML 数据类型无法进行比较或排序,除非使用 IS NULL 运算符。”
我应该如何构建我的 where 子句?
I have a stored procedure in which I need to have a where clause that reads something like:
where XMLDataPoint <> NULL
However, XMLDataPoint is an XML column and I get an error
"The XML data type cannot be compared or sorted, except when using the
IS NULL operator."
How should I structure my where clause?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
NULL
需要使用IS
或IS NOT
比较:WHERE XMLDataPoint IS NOT NULL
NULL
是一个状态(具有未知或未确定的值),本身不是值,因此等价运算符不适用。NULL
requires usingIS
orIS NOT
comparisons:WHERE XMLDataPoint IS NOT NULL
NULL
is a state (of having an unknown or undetermined value), not a value itself, so equivalence operators don't apply.