EXEC sp_MSforeachdb 'USE ?; PRINT DB_NAME()'
EXEC sp_MSforeachdb 'USE ? SELECT DB_NAME() + ''.'' + OBJECT_NAME(object_Id) FROM sys.tables'
EXEC sp_MSforeachdb 'USE ? SELECT OBJECT_NAME(object_Id) FROM sys.tables where DB_NAME() NOT IN(''master'', ''model'', ''msdb'', ''tempdb'')'
EXEC sp_MSforeachdb 'USE ?; EXEC sp_spaceused'
EXEC sp_MSforeachdb 'USE ? EXEC sp_helpfile;'
EXEC sp_MSforeachdb 'USE ?; EXEC sp_changedbowner ''sa'''
sp_MSforeachdb 'DBCC CHECKDB(?)'
Author: Petter Liu http://wintersun.cnblogs.com