Tuesday, October 16, 2012

Space available on disk


select de.name, 'Size (meg)' = (high-low+1)/512, 'Used' =  sum(u.size)/256,
        'Available (meg)'=  (high-low+1)/512 -  sum(u.size)/256
from sysdatabases da, sysusages u, sysdevices de
where da.dbid = u.dbid and u.vdevno = de.vdevno
and cntrltype = 0
group by de.name

Sometimes, I simply post these things here for my own convenience...

3 comments:

  1. Was that perhaps a test? I ran that code and every single one resulted in a negative number, more used than the size.....

    I've just found your blog, very helplful! Thanks

    ReplyDelete
  2. That was a 15.x solution; are you running 12.5.x?

    ReplyDelete
  3. How to play free slots with no deposit bonus
    Free slots are 김해 출장샵 what 강릉 출장안마 we 광명 출장마사지 call the three pillars 나주 출장마사지 of the successful casino 밀양 출장마사지 software industry. The first is simplicity, the second is accessibility. The game is the first

    ReplyDelete