【发布时间】:2011-04-09 17:08:23
【问题描述】:
我需要在结果集中找到每一列都不为空的行。
这些结果集的列数可变。
目前,我能想到的唯一方法是在每个结果集上创建一个视图并以这种方式过滤:
select field1, field2, field3, field4, ...
from "huge query"
where field1 is not null and
field2 is not null and
field3 is not null and
field4 is not null and
... is not null
有没有更好的方法在 SQL Server 或 .net 代码(c# 或 vb.net)中的存储过程/函数中执行此操作?
那么做类似的事情呢
select field1, field2, field3, field4, ...
from "huge query"
(return to .net apps or insert into #temptable)
然后在存储过程/函数或 .net 代码(c# / vb.net)中循环遍历所有行/列并标记或删除每一行得到任何空值?
我说的是超过 50 种不同类型的结果集,而且它可能会随着时间的推移而增长,所以我正在寻找一种通用/易于维护的方式
【问题讨论】:
标签: c# vb.net sql-server-2005 .net-3.5