I need to find rows in result sets, each of which contains zero.
These result sets have a variable number of columns.
Currently, the only way I can think of is to create a view for each result set and filter this way:
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
is there a better way to do this in a stored procedure / function in SQL Server or in .net code (C # or vb.net)?
What about doing something like
select field1, field2, field3, field4, ... from "huge query" (return to .net apps or insert into
and then in a stored procedure / function or .net code (C # / vb.net) loop through all rows / columns and a flag or delete every row that received zero?
I am talking about more than 50 different types of result sets and it will grow over time, so I am looking for a general / easily maintained way.
source share