How to resolve “Cannot create or update statistics on view [Table/View Name] because both FULLSCAN and NORECOMPUTE options are required.” ?
Most likely you are experiencing this error while you are trying to update statistics of a table or view using UPDATE STATISTICS command.
Please use below code to update statistics in such case:
Please use below code to update statistics in such case:
USE <Database Name>;
GO
GO
UPDATE STATISTICS <Table/View Name>
WITH FULLSCAN, NORECOMPUTE;
GO
WITH FULLSCAN, NORECOMPUTE;
GO
Also be sure to execute below step after you updates statistics. Otherwise automatic statistics update on the object in question will be stopped.
Exec sp_autostats <Table/View Name>
Another way to is to use sp_updatestats. Though internally this stored procedure will use update statistics command only, it will not actually try to update stat on the objects where it is not needed.
Code for sp_updatestats:
USE <Database Name>;
GO
GO
EXEC sp_updatestats
Comments