• SQueaLer1 (9/21/2010)


    Hi David,

    I appreciate the concept but I have to disagree with the approach. We programmers can come up with a lot of "nice" solutions, but they don't always work in the corporate world. This is a factor you haven't touched on in your article.

    Remember, we have total control over our PC with our local SQL, but in large enterprise environments, the situation is completely different.

    Your solution is not so practical because -

    * I don't have access to the server's local drive - I need it to be able to copy the DLL.

    * I am not allowed to even turn on the CLR option.

    * The function is unsafe and in corporate environments I just don't have the permissions to install it.

    * DBAs frown upon CLR.

    I can come up with more reasons, but you get the idea.

    Now, it so happens that I needed the same feature just last week.

    I implemented it in PURE SQL using just one short stored procedure. Similar code has been out there for some time. I tweaked it for my needs. I think it is generic enough to be used by anyone.

    I named it sp_fixeddrives and put it in master. This enables me to call it from any db.

    I also created a job that executes it hourly, and checks the free space %. If it falls below a threshold, I send out an alert email.

    Any chance of you posting your tweaked code for this? I'd love to see the T-SQL alternative to such as this. Thanks.

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