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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Stat Update is failing

Author  Topic 

rajkumarrai_bis
Yak Posting Veteran

78 Posts

Posted - 2008-05-16 : 17:53:06
Please help

Following is the error I am getting

Server: Msg 55555, Level 16, State 1, Procedure sp_MSforeach_worker, Line 79
sp_MSforeach_worker assert failed: command too long

following is the error generating code

use [DBNAME] if exists (select * from master.dbo.sysobjects where name = 'sp_MSforeachtable') exec sp_MSforeachtable 'update statistics ? with all'

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-05-17 : 17:07:42
Try update stats without sp_MSforeachtable.
Go to Top of Page

rajkumarrai_bis
Yak Posting Veteran

78 Posts

Posted - 2008-05-18 : 00:15:25
Rmiao,
thanks for the help
however the given code is what we have on all our servers and it is working fine on them
we want to have a uniform code on all servers
Therefore it would be great if you could help me debug the given code
besides it won't be good to change code without knowing why its failing
makes sense ?
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-05-18 : 15:32:10
"use [DBNAME]
if exists (select * from master.dbo.sysobjects where name = 'sp_MSforeachtable')
exec sp_MSforeachtable 'update statistics ? with all'"


It is working for me.
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-05-18 : 22:09:58
Since sp_MSforeachtable is undocumented sp, you either have to fix it yourself or forget it when doesn't work.
Go to Top of Page
   

- Advertisement -