Script para realizar análise de todos os bancos a procura de erros

USE MASTER

GO

EXEC master..sp_MSForeachDB '

USE [?]

IF ''?'' <> ''tempdb'' AND ''?'' <> ''msdb''

BEGIN

                                           DBCC
CHECKDB (''?'')

END'

GO