January 2008 Blog Posts

Update Statistics for all tables

Statistics in Sql Server are awesome for improving performance of queries.  There's a lot of voodoo behind the scenes, but the end result is fast, and that makes users smile. From time to time, table and index statistics get stale.  Updating statistics regularly is a good use of a sql agent job or a db maintenance plan step.  In the cases where I want to do it manually, I frequently have to search for a way to extract table names from sys tables, construct the update statistics command, and execute. The 'a-ha' moment came.  The answer is in.  It need not be...