-- check if statistics are active
Select name, is_auto_create_stats_on,is_auto_update_stats_on From sys.databases Where database_id=db_id();
-- set statistics to be active
ALTER DATABASE @DBName SET AUTO_UPDATE_STATISTICS On;
ALTER DATABASE @DBName set AUTO_CREATE_STATISTICS On;
Go
No comments:
Post a Comment