我这样做了:
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列有空条目表示零字符.
有谁知道?
试试这个:
DELETE FROM dbo.G_Scope WHERE ScopeValue IS NULL
如果不包含任何值,sql Server列将为NULL.
另一种可能性是XML不是NULL,而是包含一个空字符串作为其值.为此,请使用此命令:
-- The DATALENGTH of an empty XML column is 5
SELECT * FROM dbo.G_Scope WHERE DATALENGTH(ScopeValue) = 5
这会显示您感兴趣的行吗?
原文链接:https://www.f2er.com/mssql/77595.html