Compute clause displays nothing in Enterprise Manager

Posted on 2005-04-26
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
    LVL 28

    Accepted Solution

    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

    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

    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

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

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
    For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
    Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
    Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

    728 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

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now