• Just use sp_msforeachdb. That's what it's for. But, if you really, really don't want to use it, set up a cursor to cycle through the databases (that's all that query is anyway). If you want to get really fancy though, you could use Powershell, set up multi-threading and then pipe the command to a listing of databases. You can get simultaneous execution that way. But that's not that easy to program.

    "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