sp_updatestats (T-SQL)

Runs UPDATE STATISTICS against all user-defined tables in the current database.

Syntax

sp_updatestats

Return Code Values

0 (success) or 1 (failure)

Result Sets

None

Remarks

sp_updatestats displays messages indicating its progress. When the update is completed, it reports that statistics have been updated for all tables.

Permissions

Only members of the sysadmin fixed server role and db_owner fixed database role can execute sp_updatestats.

Examples

This example updates the statistics for tables in the pubs database.

USE pubs

EXEC sp_updatestats

  

See Also
CREATE INDEX sp_createstats
CREATE STATISTICS sp_dboption
DBCC SHOW_STATISTICS UPDATE STATISTICS
DROP STATISTICS System Stored Procedures
sp_autostats  

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.