select db information with growing size

  • I have a table which have all databse information. I need to select all the databses with their size growth for the month of january. I was able to write the query for getting that information, but I am having one problem, the problem is that I am getting two same date-time for each day for all database. I need only one date-time for each day. how do I do that. here what I have written the query.

    select dbname,collect_time,totalbytes/1024/1024 as 'Total Space (mb)',usedbytes/1024/1024

    as 'Used Space (mb)'

    from dbatools_filesize

    where collect_time>='2008-01-01' and collect_time<'2008-02-01'

    order by dbname, collect_time,totalbytes,usedbytes

  • Only way I can see that happening is if dbatools_filesize has two rows for each day for each database in it. Recommend you do a dupecheck to see...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply