检查 SQL Server 2005 XML 字段是否为空
我只是这样做:
Delete FROM MyTable WHERE ScopeValue = ""
Delete FROM G_Scope WHERE ScopeValue is ''
Delete FROM G_Scope WHERE ScopeValue = empty
Delete FROM G_Scope WHERE ScopeValue is empty
我想删除具有 xml 字段(不可为空)的所有行,其中 ScopeValue 列具有空条目意味着零个字符。
有人知道吗?
I just did this:
Delete FROM MyTable WHERE ScopeValue = ""
Delete FROM G_Scope WHERE ScopeValue is ''
Delete FROM G_Scope WHERE ScopeValue = empty
Delete FROM G_Scope WHERE ScopeValue is empty
I want to delete all rows with xml field (not nullable) where ScopeValue column has empty entries means zero chars.
Anyone knows?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
试试这个:
如果不包含任何值,SQL Server 列将为
NULL
。另一种可能性是 XML 不为 NULL,但包含空字符串作为其值。为此,请使用以下命令:
这会显示您感兴趣的行吗?
Try this:
The SQL Server column would be
NULL
is if contains no value.The other possibility would be that the XML is not NULL, but contains an empty string as its value. For that, use this command:
Does that show you the rows you're interested in?
这对我有用:
This works for me: