• I copied and pasted as is and I get the following...

    Line 35: Incorrect syntax near 'sp_msforeachdb'.

    my environment is SQL 2005 SP2.