Home Forums SQL Server 2005 Administering Update Stats with full scan on all tables in all databases RE: Update Stats with full scan on all tables in all databases

  • sunshine (9/15/2008)


    the previous statement must be terminated with a semicolon.

    this message is fairly descriptive!! The USE statement and exec must be separated by a semi colon like so

    SELECT @execmd = 'USE ' + @dbname + '';Exec sp_MSForEachTable 'Update Statistics ''?'' with FULLSCAN'''

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉