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 |
rajkumarrai_bis
Yak Posting Veteran
78 Posts |
Posted - 2008-05-16 : 17:53:06
|
Please helpFollowing is the error I am gettingServer: Msg 55555, Level 16, State 1, Procedure sp_MSforeach_worker, Line 79sp_MSforeach_worker assert failed: command too long following is the error generating codeuse [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. |
 |
|
rajkumarrai_bis
Yak Posting Veteran
78 Posts |
Posted - 2008-05-18 : 00:15:25
|
Rmiao,thanks for the helphowever the given code is what we have on all our servers and it is working fine on themwe want to have a uniform code on all servers Therefore it would be great if you could help me debug the given codebesides it won't be good to change code without knowing why its failingmakes sense ? |
 |
|
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. |
 |
|
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. |
 |
|
|
|
|