• Thanks for sharing your script.

    I would add another possible critical point: as this script's use could also be to be run against all databases for Disaster Recovery purposes, you may find problems if one or more Database collations are different from Server collation. I would advise to use the COLLATE clause in the query.

    MCITP Database administrator 2008
    MCTS SQL Server 2008 Implementation and maintenance
    MCTS Sharepoint configuration
    MCP Designing Deploying and Managing a Network Solution for the Small and Medium-sized Business
    ITIL V3 Foundation