SQL Server

From Richard's Wiki
Revision as of 00:28, 5 January 2010 by Rkdrm (Talk | contribs)

Jump to: navigation, search


Run a command on each table in a database

Use the sp_msforeachtable undocumented system stored proc, for example:

sp_msforeachTable @command1='select count(*) NR from ? where CreatedBy = ''kurzejar'' or ModifiedBy = ''kurzejar''