• It looks like the formatting gets messed up when you cut and paste. This is what I got when I cut and pasted.

    INSERT into ##TempSyncEXEC sp_msforeachdb @SQL (incorrect)

    Make sure the line reads...

    INSERT into ##TempSync

    EXEC sp_msforeachdb @SQL