EXEC master..sp_MSForeachdb 'USE [?]IF ''?'' <> ''master'' AND ''?'' <> ''model'' AND ''?'' <> ''msdb'' AND ''?'' <> ''tempdb''BEGIN SELECT ''?'' EXEC sp_ReindexingEND'
We walk in the dark places no others will enterWe stand on the bridge and no one may pass
exec master..sp_MSForeachdb'-- exit if system databaseif ''?'' in (''master'',''model'',''msdb'',''tempdb'') returnuse ?print ''Database = ''+db_name()exec sp_Reindexing'