• Ken,

    This is the type of script that I have wanted forever! Thanks. One problem, I am not able to get it to work. I copied and pasted as is and I get the following...

    Line 35: Incorrect syntax near 'sp_msforeachdb'.

    I am assuming that the Set @SQL statement is the problem (as it is all in red).

    Any help would be great.

    BTW, my environment is SQL 2005 SP2 Std.