How to Perform Update Statistics in SQL Server

Update a Specific Statistic Object in SQL Server

Method 1: Using SQL Server Management Studio

From Object Explorer, expand the database in which you want to update the statistic. Expand Table and Statistics folder. Double click or right click and select Properties.

Check the option “Update statistics for these columns” and then click OK.

Method 2: Using SQL Server Query Command

Click on new query and use the following commands,

#To update all statistics in an object 
UPDATE STATISTICS sid.TABLE-NAME

#Example
UPDATE STATISTICS dev.ITSITI

#To update for specific statistic object
UPDATE STATISTICS sid.TABLE-NAME "STATISTIC-NAME"

#Example
UPDATE STATISTICS dev.ITSITI "ITSITI~0"

Update All Statistics in SQL Server Database

Method 1: Using SQL Server Query Command

Click on new query and use the following command,

EXEC sp_updatestats;  

You May Also Like

Leave a Reply?