I am currently using the following script to update stats on all of my databases.
DECLARE @table_name varchar(1000),@sql nvarchar(4000)
declare c1 cursor for SELECT name
FROM sysobjects
WHERE xtype = 'U'
open c1
fetch next from c1 into @table_name
while @@Fetch_Status = 0
begin
Select @sql = 'UPDATE STATISTICS '+ @table_name +' WITH FULLSCAN'
--print @sql
exec sp_executesql @sql
fetch next from c1 into @table_name
end
close c1
deallocate c1
GO
One of my databases is coming up saying
Msg 2706, Level 16, State 6, Line 1
Table 'HEATSym' does not exist.
Do I have a problem with this database?
DECLARE @table_name varchar(1000),@sql nvarchar(4000)
declare c1 cursor for SELECT name
FROM sysobjects
WHERE xtype = 'U'
open c1
fetch next from c1 into @table_name
while @@Fetch_Status = 0
begin
Select @sql = 'UPDATE STATISTICS '+ @table_name +' WITH FULLSCAN'
--print @sql
exec sp_executesql @sql
fetch next from c1 into @table_name
end
close c1
deallocate c1
GO
One of my databases is coming up saying
Msg 2706, Level 16, State 6, Line 1
Table 'HEATSym' does not exist.
Do I have a problem with this database?