Given the following table:
CREATE TABLE BitValues ( n int )
Is it possible to compute the bitwise-OR of n for all rows with
n
Your best bet for a readable and re-usable solution would be to write a a custom CLR Aggregate to perform bitwise or. A tutorial for creating this type of operation can be found here: http://msdn.microsoft.com/en-us/library/91e6taax(VS.80).aspx