[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Compute clause displays nothing in Enterprise Manager

Posted on 2005-04-26
Medium Priority
Last Modified: 2013-12-03
I have a simple query with totals. Here is the query:

SELECT     D.ManufacturerId, M.CompanyName, D.DatePaid, D.Amount
FROM         PaidMfgDtl D INNER JOIN
                      dbo.Manufacturers M ON D.ManufacturerId = M.ManufacturerId INNER JOIN
                      dbo.Users U ON M.UserId = U.UserId
WHERE     (D.DatePaid > GETDATE() - 1) AND (D.DatePaid < GETDATE() + 3)
ORDER BY D.DatePaid, D.ManufacturerId
COMPUTE SUM(d .amount)

The query executes normally in Query Analyzer and displays the totals as separate query results. However, in Enterprise Manager, only the main query is displayed. How do I get the COMPUTE clause queries to display in Enterprise Manager?
Question by:jasimon9
  • 2
  • 2
LVL 28

Accepted Solution

rafrancisco earned 500 total points
ID: 13866714
COMPUTE SUM is returned as a separate result set in Query Analyzer.  Unfortunately, Enterprise Manager can only show 1 result set, therefore not showing the COMPUTE SUM output.

Author Comment

ID: 13887514
One reason I like Enterprise Manager is that it allows easy pasting into Excel for Q & D reporiting. When you cut from Query analyzer, there are no column headings.
LVL 28

Expert Comment

ID: 13887553
If you want to copy and paste to Excel to include the column headings, this can also be done in Query Analyzer.

Before running your statement, go to Tools --> Options.  Then go to Results.  In the Defaul results target, select Results to Text.  In the Results output format, select Tab Delimited.  Then click Apply.  Make sure the Print column headers is checked as well.  Then run your query.  You can then copy and paste the result to Excel.

Author Comment

ID: 13889168
Thanks for the tip. At this point, it appears that you have answered my original question so I am awarding points.

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question