How many of you wants to run a script on the whole tables in the database and don't want to do this manually???
 
well I'm one of those people who would like some sort of stored procedures which loops in all tables and apply the same script on all the tables so I've searched for this and finally I found the Undocumented SQL System Stored Procedures, they are punch of system Stored procedures which very helpfull and effective, I'll state down here two of'em and you can see the rest from here
 

sp_MSforeachdb

Sometimes, you need to perform the same actions for all databases. You can create cursor for this purpose, or you can also use the sp_MSforeachdb stored procedure to accomplish the same goal with less work.

For example, you can use the sp_MSforeachdb stored procedure to run a CHECKDB for all the databases on your server:

EXEC sp_MSforeachdb @command1="print '?' DBCC CHECKDB ('?')"

sp_MSforeachtable

Sometimes, you need to perform the same actions for all tables in the database. You can create cursor for this purpose, or you can also use the sp_MSforeachtable stored procedure to accomplish the same goal with less work.

For example, you can use the sp_MSforeachtable stored procedure to rebuild all the indexes in a database:

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