Getting File System Volume Info

  • Comments posted to this topic are about the item Getting File System Volume Info

  • You can get the C drive size from sys.dm_os_volume_stats view only when you have a database on C drive.

    "Returns information about the operating system volume (directory) on which the specified databases and files are stored in SQL Server."

    The answer is not correct, sorry.

  • I agree with ilyaioffe, which means that the most correct answer is actually the XP_CmdShell answer which, by the way, IS also a supported answer.

    What you have listed as a correct answer isn't actually correct for the reason that ilyaioffe posted.

    --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)

  • Altered the question to note a database file on the c: drive.

     

  • This is a really handy bit if information, thanks Steve

    ____________________________________________
    Space, the final frontier? not any more...
    All limits henceforth are self-imposed.
    “libera tute vulgaris ex”

  • 3 alternative ways for your mind entertainment

    1. Use sp_send_dbmail  to send an email  with the size question to your Windows administrator 🙂
    2. 2. Use DriveInfo class class to create a CLR procedure
    3. Run an Agent job of PowerShell type.

    Regards,Yelena Varsha

  • There is a new DMV added for this with 2019. And it's not listed. So that new DMV should be the correct answer and the question wouldn't have had to be changed. sys.dm_os_enumerate_fixed_drives

    Sue

Viewing 7 posts - 1 through 6 (of 6 total)

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