USE AdventureWorks;
GO
/* Enable Stats and Auto Update */
— Enable Auto Create of Statistics
ALTER DATABASE AdventureWorks
SET AUTO_CREATE_STATISTICS ON;
— Enable Auto Update of Statistics
ALTER DATABASE AdventureWorks
SET AUTO_UPDATE_STATISTICS ON;
GO
— Update Statistics for whole database
EXEC sp_updatestats
GO