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
 General SQL Server Forums
 Script Library
 Undocumented SQL proc : sp_MSforeachdb

Author  Topic 

hgorijal
Constraint Violating Yak Guru

277 Posts

Posted - 2004-10-12 : 06:33:01
Executes the statement for each database in the server.

Ex : EXEC sp_MSforeachdb @command1='PRINT ''Listing ?''', @command2='USE ? SELECT DB_NAME()'


Hemanth Gorijala
BI Architect / DBA...
   

- Advertisement -