Another quick example - to print out all the table names in a db, just run:
EXEC sp_MSForEachTable "UPDATE STATISTICS ?"
FYI, there's also sp_MSForEachDB that lets you do the same operation on all databases on the server. Learning this alone was worth the price of Brian Knight's "Admin 911: SQL Server 2000" book.
EXEC sp_MSForEachTable "PRINT '?'"