Undocumented sp_MSforeachtable stored procedure

by dotnetpete 29. April 2009 12: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

Comments

9/10/2009 2:43:25 AM #

As a Newbie, I am always searching online for articles that can help me. Thank you

bad credit loans

Add comment




biuquote
Loading



Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen

dotnetpete

Hi I'm dotnetpete. I'm an owner and software developer at Advantech Software in Brisbane, Australia. My passions are writing great software and coffee.

RecentPosts