Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
reddy_vam
Starting Member
43 Posts |
Posted - 2008-11-05 : 23:10:16
|
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. |
|
SimpleSQL
Yak Posting Veteran
85 Posts |
Posted - 2008-11-06 : 00:59:29
|
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. |
|
|
panoslondon1
Starting Member
2 Posts |
Posted - 2009-07-06 : 07:27:38
|
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. |
|
|
exOracloid
Starting Member
1 Post |
Posted - 2011-05-09 : 15:19:36
|
I realize this is an old thread but still for the reference of whoever comes accross it in search of a workaround:http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=114332/*Update Statistics in All User DatabasesWorks in SQL Server 2005 and above BY Michael Valentine Jones*/declare @cmd nvarchar(max)set @cmd = ''-- Build command to update statisticsselect @cmd = @cmd+'use '+quotename(a.name)+'print ''*** Start Update Statistics for database ''+quotename(db_name())+'' at ''+convert(varchar(30),getdate(),121)exec sp_updatestatsprint ''*** End Update Statistics for database ''+quotename(db_name())+'' at ''+convert(varchar(30),getdate(),121)'from(select top 100 percentaa.namefromsys.sysdatabases aawhere-- Exclude system database-- Add more database names to exclude as needed.name not in ('master','model','msdb','tempdb') and-- Include only databases that are onlinedatabasepropertyex(aa.name,'Status') = 'ONLINE' and-- Include only databases that are updatabledatabasepropertyex(aa.name,'Updateability') = 'READ_WRITE' and-- Exclude databases in single user modedatabasepropertyex(aa.name,'UserAccess ') in ('RESTRICTED_USER','MULTI_USER')order byaa.name) aprint '*** Start Update Statistics at '+convert(varchar(30),getdate(),121)exec ( @cmd ) -- Execute Update Statistics commandsprint '*** End Update Statistics at '+convert(varchar(30),getdate(),121)ex-Oracloid. (kind-of. 'cause there are no "ex" true Oracle followers ;-) |
|
|
|
|
|
|
|