16 June,2012 by Jack Vamvas
Question: During a regular maintenance UPDATE STATISTICS tasks I’m getting the following error:
Cannot create or update statistics on view "dbo.myView" because both FULLSCAN and NORECOMPUTE options are required. [SQLSTATE 42000]
How can I fix it?
Answer: The UPDATE STATISTICS is trying to update statistics on a VIEW. On a SQL VIEW a FULLSCAN is required.
On a SQL Server Instance this can cause a problem – particularly if you’re running a catch-all script. A FULLSCAN could cause servere delays on an UPDATE STATISTICS job – if every object required a FULLSCAN.
Some options are:
1) Create different scripts for VIEWS
2) Use sp_updatestats - which only only updates on objects which need the update
This is only a preview. Your comment has not yet been posted.
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.
Posted by: |