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.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 update and create stats difference

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

Posted - 2009-10-05 : 13:46:58
Logically speaking they do the same thing in all of the versions. Physically though, I'm sure Microsoft has made improvements.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

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 .
Go to Top of Page

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 Shaw
SQL Server MVP
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-10-06 : 12:36:07
We have both auto create and auto update enabled on our systems. We also have asynch auto update enabled on some of our systems. We also perform nightly or weekly updating of stats via sp_update_stats on some systems and UPDATE STATS on other systems.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -