Home Forums Programming Powershell using Sqlpsx functions on a production sql box RE: using Sqlpsx functions on a production sql box

  • Indianrock (8/24/2013)


    Saving to files with timestamp in the name. The request was to keep error log entries ( other than backup/logon messages ) for a year. I could use the xp_ReadErrorLog approach to write to a table, but thought I'd try powershell.

    Although there are certainly some great benefits to using PowerShell for certain things, I tend to stay within the confines of SQL Server if it can be done there. A lot of people will disagree with it but I have several WMI "collectors" of data written in PowerShell that I call from T-SQL using xp_CmdShell. People will also disagree with this just because I use xp_CmdShell but we have the system very well locked down and we have no under-privileged users that have been proxied out to use it directly.

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