Adaptive Server ADO.NET Data Provider now supports Transact-SQL queries that include a COMPUTE clause. A COMPUTE clause lets you include detail and summary results in a single select statement. The summary row follows the detail rows of a specific group, as shown here:
select type, price, advance from titles order by type compute sum(price), sum(advance) by type
type price advance ------------ --------- ---------- UNDECIDED NULL NULL Compute Result: ------------------------ ------------------------ NULL NULL type price advance ------------ --------- ---------- business 2.99 10,125.00 business 11.95 5,000.00 business 19.99 5,000.00 business 19.99 5,000.00 Compute Result: ------------------------ ------------------------ 54.92 25,125.00 ... ... (24 rows affected)
When Adaptive Server ADO.NET Data Provider executes a select statement that includes a COMPUTE clause, the provider returns multiple result sets to the client. The number of result sets depends on the number of unique groupings available. Each group contains one result set for the detail rows and one result set for the summary. The client must process all result sets to fully process the rows returned; if it does not, only the detail rows of the first group of data are included in the first result set returned.See the Adaptive Server Enterprise Transact-SQL Users Guide for more information about the COMPUTE clause.See the ADO.NET Programmers Guide on the Microsoft Web site for more information about processing multiple result sets.