Wednesday, March 28, 2012

Is it possible to mass update stats?

SQL Server 2000 on Win2k

I'm fairly new to SQL Server and I'm just wondering if it's possible to Update Statistice for all indexes somehow? I'm looking at the Update Statistics command and it doesn't seem to be possible.

The situation we have is a reporting DB that basically has all it's tables truncated and remade every night by some DTS jobs that import from another datasource and change the data and build some denormalzed tables etc.
Some of the large Insert operations go from taking 8 mins to taking several hours sometimes and updating the stats seems to fix the problem for a while. So I'd like to make sure the optimizer has all the latest stats for all tables.

Any other advice would be appreciated.

Cheers.EXECUTE sp_updatestats 'resample' (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_sp_ua-uz_14kz.asp)

-PatP|||Cool cheers ... From the help on that it doesn't seem like I can set the sample size.
From that I noticed links to sp_createstats so I might drop the stats and recreate them with a higher sample rate.

THANKS!

No comments:

Post a Comment