Difference between revisions of "SQL Server"
From Richard's Wiki
(New page: * [http://msdn.microsoft.com/en-us/library/aa302392.aspx Building Secure ASP.NET Applications: Authentication, Authorization, and Secure Communication]) |
|||
Line 1: | Line 1: | ||
* [http://msdn.microsoft.com/en-us/library/aa302392.aspx Building Secure ASP.NET Applications: Authentication, Authorization, and Secure Communication] | * [http://msdn.microsoft.com/en-us/library/aa302392.aspx Building Secure ASP.NET Applications: Authentication, Authorization, and Secure Communication] | ||
+ | |||
+ | |||
+ | == Run a command on each table in a database == | ||
+ | Use the sp_msforeachtable undocumented system stored proc, for example: | ||
+ | |||
+ | <nowiki>sp_msforeachTable @command1='select count(*) NR from ? where CreatedBy = ''kurzejar'' or ModifiedBy = ''kurzejar''</nowiki> |
Revision as of 00:28, 5 January 2010
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''