Iterating through all the SQL Server databases and tables.

added by rpk2006
4/25/2012 8:03:51 AM

0 Kicks, 75 Views

SQL Server (2005 and above) contains two undocumented stored procedures, viz. sp_MSforeachdb and sp_MSforeacheable which can be used to loop through all the databases and tables and execute a command.