• If any one is having troubkle with this (on SQL 2005) make sure that the INSERT statement reads as follows...

    INSERT into ##TempSync EXEC sp_msforeachdb @SQL

    For some reason the ##TempSync & EXEC are run together if you just copy and paste.

    Mark