How can I get column totals with group breaks

We manually generate a report of file groups and their associated data files each day for each of our databases.
For each database we take data from dbcc showfilestats and assemble it into an Excel spreadsheet (see below).
I would like to use a SQL job to generate the reports (results do not need to be in Excel format). I can insert the data from the DBCC into a table; but, I'm stuck on how to write a select statement that will break on file group and provide column totals.
I've been looking at group by; but, I don't see how to make it work.
Suggestions?
FileGroup
FileID
Volume
Allocated(MB)
Used space(MB) 
Free space(MB)
Used %
1
1
Data1
100
50
50
50%
1
15
Data2
200
175
125
87.50%
1
21
Data3
300
200
100
6.60%
            600
425
275
70.80%
FileGroup
FileID
Volume
Allocated(MB)
Used space(MB) 
Free space(MB)
Used %
2
1
index1
100
50
50
50%
2
15
index2
200
175
125
87.50%
2
21
index3
300
200
100
6.60%
600
425
275
70.80%

Take a look at the following blog on subtotal, total & grand total:
http://www.sqlusa.com/bestpractices2005/subtotaltotalgrandtotal/
It appears that you need only 1 level of totals.
BOL:
Summarizing Data Using ROLLUP
Kalman Toth Database & OLAP Architect
SELECT Video Tutorials 4 Hours
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

Similar Messages

  • How can I get an album with multiple artists to display in my Nano as one album insteadof multiple albums?

    How can I get an album with multiple artists to display in my Nano as one album insteadof multiple albums?

    See this page for helpful information.
    http://samsoft.org.uk/iTunes/grouping.asp
    B-rock

  • I purchased an ablum thru itunes on my phone and it says i purchased the songs on itunes but when i go on my music it says i have to repurchase all the songs how can i get the songs with out havin to pay again

    I purchased an ablum thru itunes on my phone and it says i purchased the songs on itunes but when i go on my music it says i have to repurchase all the songs how can i get the songs with out havin to pay again

    Whether you can redownload music depends upon what country that you in. If you are using your computer's iTunes then does music show in the Purchased link under Quicklinks on the right-hand side of the iTunes store home page (on your phone you might be able to redownload media via the Purchased tab in the iTunes store app) ? If music shows there, but not that album, then check to see if it's hidden : http://support.apple.com/kb/HT4919
    If you aren't in a country when you can redownload music and it's still on your phone then you should be able to copy it over from the phone via File > Devices > Transfer Purchases.

  • How can I get the variable with the value from Thread Run method?

    We want to access a variable from the run method of a Thread externally in a class or in a method. Even though I make the variable as public /public static, I could get the value till the end of the run method only. After that scope of the variable gets lost resulting to null value in the called method/class..
    How can I get the variable with the value?
    This is sample code:
    public class SampleSynchronisation
         public static void main(String df[])
    sampleThread sathr= new sampleThread();
    sathr.start();
    System.out.println("This is the value from the run method "+sathr.x);
    // I should get Inside the run method::: But I get only Inside
    class sampleThread extends Thread
         public String x="Inside";
         public void run()
              x+="the run method";
    NB: if i write the variable in to a file I am able to read it from external method. This I dont want to do

    We want to access a variable from the run method of a
    Thread externally in a class or in a method. I presume you mean a member variable of the thread class and not a local variable inside the run() method.
    Even
    though I make the variable as public /public static, I
    could get the value till the end of the run method
    only. After that scope of the variable gets lost
    resulting to null value in the called method/class..
    I find it easier to implement the Runnable interface rather than extending a thread. This allows your class to extend another class (ie if you extend thread you can't extend something else, but if you implement Runnable you have the ability to inherit from something). Here's how I would write it:
    public class SampleSynchronisation
      public static void main(String[] args)
        SampleSynchronisation app = new SampleSynchronisation();
      public SampleSynchronisation()
        MyRunnable runner = new MyRunnable();
        new Thread(runner).start();
        // yield this thread so other thread gets a chance to start
        Thread.yield();
        System.out.println("runner's X = " + runner.getX());
      class MyRunnable implements Runnable
        String X = null;
        // this method called from the controlling thread
        public synchronized String getX()
          return X;
        public void run()
          System.out.println("Inside MyRunnable");
          X = "MyRunnable's data";
      } // end class MyRunnable
    } // end class SampleSynchronisation>
    public class SampleSynchronisation
    public static void main(String df[])
    sampleThread sathr= new sampleThread();
    sathr.start();
    System.out.println("This is the value from the run
    method "+sathr.x);
    // I should get Inside the run method::: But I get
    only Inside
    class sampleThread extends Thread
    public String x="Inside";
    public void run()
    x+="the run method";
    NB: if i write the variable in to a file I am able to
    read it from external method. This I dont want to do

  • How can I get the variable with the value from Thread's run method

    We want to access a variable from the run method of a Thread externally in a class or in a method. Even though I make the variable as public /public static, I could get the value till the end of the run method only. After that scope of the variable gets lost resulting to null value in the called method/class..
    How can I get the variable with the value?
    This is sample code:
    public class SampleSynchronisation
         public static void main(String df[])
    sampleThread sathr= new sampleThread();
    sathr.start();
    System.out.println("This is the value from the run method "+sathr.x);
    /* I should get:
    Inside the run method
    But I get only:
    Inside*/
    class sampleThread extends Thread
         public String x="Inside";
         public void run()
              x+="the run method";
    NB: if i write the variable in to a file I am able to read it from external method. This I dont want to do

    Your main thread continues to run after the sathr thread is completed, consequently the output is done before the sathr thread has modified the string. You need to make the main thread pause, this will allow sathr time to run to the point where it will modify the string and then you can print it out. Another way would be to lock the object using a synchronized block to stop the main thread accessing the string until the sathr has finished with it.

  • How can I get motherboard ID with flex?

    How can I get motherboard ID with flex? I tried many. But I cannot find some way..

    select distinct group_id
      from tab_tmp t
    where t.group_id not in (select distinct t2.group_id
                                from tab_tmp t2
                               where t2.colour = 'BLACK');
            GROUP_ID
    1     2220052-----
    Edited by: stefan nebesnak on Feb 24, 2013 9:02 AM
    In the TEST table there are the 'BLUE' and 'GREEN' values together in all cases, which confused me. ツ
    <tt>
    GROUP_ID     COLOUR     KEY
    <font color="#FF0000">--1--</font>
    8311226          <font style="background-color: #E7FA6B">GREEN</font>     12428183
    8311226          <font style="background-color: #D7CEFF">BLUE</font>     12428183
    8311226          <font style="background-color: #E7FA6B">GREEN</font>     35428017
    8311226          BLACK     5415875
    <font color="#FF0000">--2--</font>
    2220052          <font style="background-color: #E7FA6B">GREEN</font>     12253085
    2220052          WHITE     12253085
    2220052          <font style="background-color: #D7CEFF">BLUE</font>     84553085
    <font color="#FF0000">--3--</font>
    3029178          BLACK     54587856
    3029178          <font style="background-color: #D7CEFF">BLUE</font>     54587856
    3029178          <font style="background-color: #E7FA6B">GREEN</font>     67080752
    </tt>

  • İ have an hp 3052 all in one.how can i get print out with ipad or iphone?

    İ have an hp 3052 all in one.how can i get print out with ipad or iphone?

    Hello,
    Try following the instructions here http://h10025.www1.hp.com/ewfrf/wc/document?docname=c02623193&cc=ad&dlc=en&lc=en&jumpid=reg_r1002_us...
    If that does not help, let me know and I will see what I can do.
    -------------How do I give Kudos? | How do I mark a post as Solved? --------------------------------------------------------

  • How can I get wireless printing with my ipad?

    How can I get wireless printing with my ipad?

    Best way is to use an AirPrint compatible printer:
    http://support.apple.com/kb/HT4356
    If your printer is not AirPrint compatible, you might want to take a look at Printopia.
    http://www.ecamm.com/mac/printopia/

  • How can I get cloud totally off my ipad -

    How can I get cloud totally off my ipad - I hate the tabs it installed on Safari.  I deleted the account on Ipad but it is still there (just asking for sign in) and still tabs taking up space on an already small screen...thx! Or even how to remove the tabs!

    Apple does not support downgrading. Have you tried to reset your router?
    Or gone into the settings, general, reset, reset all network settings?

  • I downloaded garage band on my iPad ages ago but now it just says waiting and when I click on it it just says "retry" and does nothing. I've spent literally ages making songs (I've got like 20 ). How can I get it back with all my songs still there?

    I downloaded garage band on my iPad ages ago but now it just says waiting and when I click on it it just says "retry" and does nothing. I've spent literally ages making songs (I've got like 20 ). How can I get it back with all my songs still there?

    Thanks for that. Much more constructive than the last comment. It's only the restriction code I can't recall, not the access passcode. So I can currently access the device, just not age restricted content. Does that's make a difference? I also wondered if anyone knew how many attempts you get to try to get it right. Now tried 21 times and so far nothing bad has happened but I am concerned I'll eventually be completely locked out of the device. That doesn't seem in the spirit of things though. Surely it's foreseeable that a child could repeatedly try to guess the code so I can't see that it would be right to lock the device down completely in that circumstance, particularly if the access code is being typed in correctly every time.
    Thanks

  • How can I  get System dates  with time scheduler using threads

    how can I get System dates with time scheduler using threads.is there any idea to update Date in my application along with system Date automatic updation...

    What the heck are you talking about and whatr has it to do with threads?
    Current time: System.currentTimeMillis. Date instances are not supposed to be updated.

  • How can I get my ipad2 with os5 to Kodak wireless printer esp9.

    How can I get my ipad2 with os5 to Kodak wireless printer esp9.

    Airprint won't work with the Kodak printers because Kodak does not support Airprint.  You'll need to check in the App store to see if Kodak makes a printing app for the iPad.  Otherwise, there are a number of third party printing apps.  People have used Printopia, Print n Share, and Print Central with good results.

  • How can I get a report with total number of pages printed on my HP Officejet Pro 8610?

    Since knowing the number of pages I print is so critical to a choice of using the "HP Instant Ink Plan" or not, how can I find the total number of pages I have printed on my brand-new (installed 2 days ago) 8610?  And if I can, is it a "resettable" or rolling total?  Don't see anything in user guide and a search yields nothing usable on this blog.
    Printer is installed wirelessly on an older PC with Windows XP SP3.  I can also of course intstall it with network cable but so far it works OK on my home network without network cable.  If it matters which OS, I also have a Lenovo laptop running Vista on which I can install this printer. 
    Please do not respond that I can find the total by counting the number of pieces of paper I have.  Surely the internals of this fine machine must have the requested data so that HP can tell my usage if I select the monthly ink plan!
    This 8610 was a good buy (net $89.00 after trade-in of my six year old J36xx Deskjet) at Office Depot/Max which of course influenced my decision to buy it.  So far I am very happy with printing qualities and speed, have not tried the scanner yet and will probably never use the fax since I have no land line phone. 
    Thanks,
    Harry
    This question was solved.
    View Solution.

    Hi,
    Section #2 of the Printer Ststus report will tell you. Please try:
    Printer status report
    Use the printer status report to view current printer information and ink cartridge status. Also use the printer status report to help you troubleshoot problems with the printer.
    The printer status report also contains a log of recent events.
    If you need to call HP, it is often useful to print the printer status report before calling.
    To print the Printer Status Report
    1. From the printer control panel display, touch and slide your finger across the screen and then touch Setup.
    2. Touch Print Reports and then touch Printer Status Report.
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • How can I get iPod touch with IOS5 to sort by song artist and not album artist?

    Since updating to IOS5 many song artist are missing. I set up iTunes to sort on song artist but when I sync, my ipod tyrs to sort by album artist not song artist. How can I get the ipod touch to sort by song artist???? Most of my Song artists show up under Various which is the entry for album artist. Please help! I have aver 9000 songs with this problem. If I can't solve this issue, I will have to return to using my Toshiba Gigabeat which allows me to sort be album artist. IOS-5 was a step backwards.

    Go to settings.
    Music> Turn off Group by Artist

  • How can I replace column value with a particular value in SQL

    Hi All,
    Can anyone please tell me how can I format my output with replacing a column value with a specific value which actually depends on the present value of the column
    I am executing the following SQL statement
    select state,count(id) from <table_name> where composite_dn= <composite_dn_name> group by state;
    My Present output is:
    State No.Of Instance
    1 3
    3 28
    I want to replace the value in the column state as follows
    State No.OfInstances
    Completed 3
    Faulted 28
    I want "1" to be reppaced by "Completed" and "3" to be replaced by "Faulted"
    Is is possible with SQL or PL/SQL , if it is then how can I achieve this required result. Please help!!
    Thanks in Advance!!
    Edited by: Roshni Shankar on Oct 27, 2012 12:38 AM

    Hi Roshni,
    I guess this CASE clause can be simulated by a DECODE and also it is very easy to use.
    Refer -- http://www.techonthenet.com/oracle/functions/decode.php
    select decode(t1.state,t2.state_id,t2.state_name), t1.count_id
    from <table_2> t2, (select state,count(id) count_id
    from <table_name>
    where composite_dn= <composite_dn_name>
    group by state) t1
    where t1.state = t2.state_id;HTH
    Ranit B.
    Edited by: ranit B on Oct 27, 2012 2:02 PM
    -- link added
    Edited by: ranit B on Oct 27, 2012 2:19 PM
    -- sample code added

Maybe you are looking for