You could look at using COMPUTE. The only problem would be that it generates multiple resultsets. Alternatively, you could use a UNION to include the totals as part of the same resultset. If you did this within your views, I'd suggest adding a static value as an additional column to identify the Totals row, thereby allowing you to exclude it if desired. I.e.SELECT mt.Col1 AS Col1 ,mt.Col2 AS Col2-- etc ,'Detail' AS RowTypeFROM dbo.MyTable AS mtUNION ALLSELECT SUM(mt.Col1) ,SUM(mt.Col2)-- etc ,'Total'FROM dbo.MyTable AS mt
Mark