Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Hitesh Shah
Yak Posting Veteran
80 Posts |
Posted - 2009-10-05 : 04:42:30
|
What's the difference between sp_createstats and sp_updatestats in SQL 2k. Is it any different in SQL 2k5 and SQL 2k8 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
Hitesh Shah
Yak Posting Veteran
80 Posts |
Posted - 2009-10-06 : 02:04:44
|
Thanks for the reply. As a practice what people run periodically . sp_updatestats or sp_createstats or both in what sequence to keep stats updated properly . |
 |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2009-10-06 : 03:00:12
|
sp_createstats does just that. It creates a statistics set. Once a stats set has been created (manually or automatically if auto_create_stats is on) it's not necessary to create it again.sp_updatestats is the one that updates statistics. It may be necessary to run that, or more likely to run UPDATE STATISTICS, to keep stats up to date. If auto_update_stats is on then SQL will automatically maintain statistics and you only need to update when the automatic update isn't enough--Gail ShawSQL Server MVP |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|