How to update statistics ? TIP #14

b

In last TIP tip#13, We learn how to find last updated statistics status.

Now we know when it last updated so it may be require we need to update statistics for some of table.

So to update statistics we need to write following command ( if we want to update  statistics of entire tables objects)

Go

EXEC sp_updatestats;

GO

Update_Statistics_All

Now if we want to  update statistics of particular table then we need to write following command

GO

UPDATE STATISTICS tblProductStock

GO

Now if we want to update statistics of particular index of a table then we need to write following command

GO

UPDATE STATISTICS tblCustomer PK_tblCustomer;

GO

WHERE tblcustomer is table name and pk_tblCustomer is primary key

 

So enjoy !!!

GO

Leave a Reply

Your email address will not be published. Required fields are marked *