• Going to all databases on a server, you have to do some type of cursor. sp_msforeachdb is a good as anything.

    If you have to go to lists of specific databases, cursors are still the way to go, but I'd move the cursor into PowerShell and make the calls that way.

    "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