Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Maintenance plan fails: Cannot create or update s
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

43 Posts

Posted - 11/05/2008 :  23:10:16  Show Profile  Reply with Quote
Hi Folks,

The "Update Statistics Task" of Maintenance Plan is failing with a error
"Cannot create or update statistics on view "View name" because both FULLSCAN and NORECOMPUTE options are required.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly."

I am running on SQL Server 2005, sp2

I tried all the forums, but couldn't find exact solution for this issue.

Any help resolving this issue will be appriciated.

Yak Posting Veteran

85 Posts

Posted - 11/06/2008 :  00:59:29  Show Profile  Reply with Quote
If the view references from more than one base table, statistics have to be
created with FULLSCAN and NORECOMPUTE. SAMPLE cannot be specified in this case.
SAMPLE can be specified only when the view is based on a single table. Note that
self joins are counted as two base tables.
Go to Top of Page

Starting Member

2 Posts

Posted - 07/06/2009 :  07:27:38  Show Profile  Reply with Quote
My view that creates the problem only references 1 table, not 2. I have 2 updates stats tasks in SSIS. 1 to update tables and another to update views.
Go to Top of Page

Starting Member

1 Posts

Posted - 05/09/2011 :  15:19:36  Show Profile  Reply with Quote
I realize this is an old thread but still for the reference of whoever comes accross it in search of a workaround:

Update Statistics in All User Databases
Works in SQL Server 2005 and above

BY Michael Valentine Jones


declare @cmd nvarchar(max)
set @cmd = ''

-- Build command to update statistics
select @cmd = @cmd+
use '+quotename('

print ''*** Start Update Statistics for database ''+quotename(db_name())+
'' at ''+convert(varchar(30),getdate(),121)

exec sp_updatestats

print ''*** End Update Statistics for database ''+quotename(db_name())+
'' at ''+convert(varchar(30),getdate(),121)

select top 100 percent
sys.sysdatabases aa
-- Exclude system database
-- Add more database names to exclude as needed.
name not in ('master','model','msdb','tempdb') and
-- Include only databases that are online
databasepropertyex(,'Status') = 'ONLINE' and
-- Include only databases that are updatable
databasepropertyex(,'Updateability') = 'READ_WRITE' and
-- Exclude databases in single user mode
databasepropertyex(,'UserAccess ') in ('RESTRICTED_USER','MULTI_USER')
order by
) a

print '*** Start Update Statistics at '+convert(varchar(30),getdate(),121)
exec ( @cmd ) -- Execute Update Statistics commands
print '*** End Update Statistics at '+convert(varchar(30),getdate(),121)

ex-Oracloid. (kind-of. 'cause there are no "ex" true Oracle followers ;-)
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000