msforeachtable not working in 2005

  • I am running this

    Exec sp_MSForEachTable 'Update Statistics "?" with FULLSCAN'

    and getting this error

    Msg 102, Level 15, State 1, Line 1

    Incorrect syntax near '[dbo].[zipcode]'.

    Any idea why?

    ¤ §unshine ¤

  • sp_MSForEachTable replaces the question mark directly, so what you ended up with was:

    Update Statistics "[dbo].[zipcode]" with FULLSCAN

    If you remove the double quotes from your query, it should work.

    Hope this helps!

    Chad

  • It does. Thanks!

    ¤ §unshine ¤

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply