• mike.renwick-894639 (5/6/2010)


    I personally haven't found a great deal of info on how to script objects using SMO which is why I think people end up doing slightly scary things like querying syscomments and other arcane solutions. From the snippets on the net we've been able to sort of work SMO out but it always seems to require a few extra steps of understanding to make use of, e.g. smo is a c# library seemingly, accessible from powershell, but could equally be rolled into a CLR storedproc.

    I've hated having to make uninformed choices as to where run this sort of stuff from or how to architect it to "best practice" quality standards.

    Does anyone have a book to recommend that delves into the powershell scripting side of sql server more?

    Yep, "SQL Server 2008 Administration with PowerShell" by Anathakumar Muthusamy & Yan Pan.

    I'm sure I mispelled one of those names.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning