在 SQL 2008 的 where 子句中使用 XML 列

发布于 2024-12-26 11:49:03 字数 246 浏览 2 评论 0原文

我有一个存储过程,其中需要有一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

獨角戲 2025-01-02 11:49:03

NULL 需要使用 ISIS NOT 比较:

WHERE XMLDataPoint IS NOT NULL

NULL是一个状态(具有未知或未确定的值),本身不是值,因此等价运算符不适用。

NULL requires using IS or IS 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文