Undocumented sp_MSforeachtable stored procedure

by dotnetpete 29. April 2009 13:31

Found a very cool undocumented stored procedure in SQL today.

For example if I want to rebuild all indexes for all tables I could do

sp_MSforeachtable @command1="print '?' DBCC DBREINDEX ('?')"

Very handy! 

Tags:

SQL2008

Add comment




biuquote
Loading