• Also not being snarky, but I've found that the reason a lot of people turn to PowerShell is because they don't actually know what they're doing in SQL Server. For example, I've seen many a script for having PoSH do all backups for the entire enterprise from a central location. While that sounds fine, that makes the enterprise reliant on a single point of failure. It would be far better to use PoSH to distribute and activate standalone backup routines to the individual systems so that there is no single point of failure for this most important activity.

    SQL Server is pretty good at what it does and can do especially when you get a little T-SQL involved. To coin a phrase, "Just because you can do something in PowerShell, doesn't mean you should". See the sister-phrase to that in my signature line below.

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