Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2010
    Posts
    72

    Unanswered: calculating free space of database

    I wrote the below query to calculate the free data space avaialble for each database present in the server. Can any of you please go through this and correct if I am wrong.
    -------------------------------------------
    select
    "DB"= convert(char(10),db_name(dbid)),
    "DB_Free_Space_Percentage" = convert(varchar(6),round(sum(unreservedpgs) * 100 / sum(size),0))
    from sysusages u
    where segmap = 3 and dbid not in (3,31513,31514)
    group by dbid
    order by 2

    ----------------------------------------

    Thank you

  2. #2
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    Looks OK to me

  3. #3
    Join Date
    Jun 2009
    Posts
    25
    If the name of your db's are less than 10 characters then i think it is ok

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •