Runs UPDATE STATISTICS against all user-defined tables in the current database.
sp_updatestats
0 (success) or 1 (failure)
None
sp_updatestats displays messages indicating its progress. When the update is completed, it reports that statistics have been updated for all tables.
Only members of the sysadmin fixed server role and db_owner fixed database role can execute sp_updatestats.
This example updates the statistics for tables in the pubs database.
USE pubs
EXEC sp_updatestats
CREATE INDEX | sp_createstats |
CREATE STATISTICS | sp_dboption |
DBCC SHOW_STATISTICS | UPDATE STATISTICS |
DROP STATISTICS | System Stored Procedures |
sp_autostats |