1 2 0 3 4 0
Note that c and f are 0 because they are not included in the cycle.
In one process I need to know how many columns are non zero.So the challenge is to find out the how many non zero columns there are, the twist is to use as little code as possible. Oh and scalar user defined functions are out because TSQL Scalar functions are evil.
Please post answers as comments or email to me using the contact page.
[Note: this needs to be usuable as a computed column. The non zero values will always be in consequtive list of values from 1)