Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 sp_MSForEachDb does not run through all databases

Author  Topic 

Artoo
Starting Member

16 Posts

Posted - 2009-03-24 : 02:32:13
Hi,

I have a strange one here.

If I run [EXEC sp_MSForEachDb 'SELECT ''?'''] I only get a result for 15 databases. I have 40 databases on this server. The db's that are being ignored are db_id 20 and higher.

I recently upgraded this server from SQL 2000 to SQL 2005.

Any input would be appreciated.

Artoo
Starting Member

16 Posts

Posted - 2009-03-24 : 02:43:04
This is now working.

I saw some db's were set to autoclose. I set autoclose off for all db's.
I also ran DBCC CHECKDB.
Go to Top of Page
   

- Advertisement -