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_MSforeachtable

Author  Topic 

hgorijal
Constraint Violating Yak Guru

277 Posts

Posted - 2004-10-12 : 06:35:29
Executes the statement for each table in the database.
Ex :
EXEC sp_MSforeachtable @command1='PRINT ''Listing ?''', @command2='SELECT * FROM ?',@whereand=' AND name like ''Order%'''



Hemanth Gorijala
BI Architect / DBA...
   

- Advertisement -