Getting this error when I run on SQL Server 2008:
Msg 156, Level 15, State 1, Line 24
Incorrect syntax near the keyword 'END'.
Msg 102, Level 15, State 1, Line 37
Incorrect syntax near 'DECLARE
EXEC sp_MSforeachdb
@pages BIGINT -- Working variable for size calc.
,@dbname SYSNAME
,@dbsize BIGINT
,@logs'.