is a stored procedure used to loop through all the tables in the database. We can use this in different situations. For example, we want to run command to disable all triggers, then we could write that like this:
sp_msforeachtable "ALTER TABLE ? DISABLE TRIGGER all"
? will be replaced with table name.
I think you will enjoy this.
For details, click here