• you can modify the following line to handle more naming possibilities on tables

    SET @Statement = 'UPDATE STATISTICS ' + '[' + @tablename + ']' + ' WITH FULLSCAN'