Maitenance plan generated T-sql for nonexisting indexes and table

I have a weird problem which our weekly maintenance plan for reorganize was keep failing  with a following errors


Executing the query "ALTER INDEX [Samba_2_Indexes_CL2] ON [dbo].[Samba_2] REORGANIZE WITH ( LOB_COMPACTION = ON )
" failed with the following error: "Cannot find the object "dbo.Samba_2" because it does not exist or you do not have permissions.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

I have verified a table samba2 is no longer exist in the db but again when I generate the T-sql from reorganize maintenance task, The wizard still generated T-sql for that table.
motioneyeAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Rich WeisslerConnect With a Mentor Professional Troublemaker^h^h^h^h^hshooterCommented:
Could be hard coded in the maintenance plan.
I'd assumed motioneye was using the maintenance plans built in with the wizard from MS SQL.  In that case, I question whether there might be an error in the catalog which DBCC would correct.  If that is the case, unfortunately Ola Hallengren's script will also give a (likely different) error.
0
 
Rich WeisslerProfessional Troublemaker^h^h^h^h^hshooterCommented:
Do you have an integrity check running as part of your maintenance plan?
Does DBCC CHECKDB come back clean?
0
 
David ToddConnect With a Mentor Senior DBACommented:
Hi,

I use Ola Hallengren's free maintenance script.
http://ola.hallengren.com/

The beauty about this script and the jobs it creates is: user_databases is evaluated at run-time, so selects all the user databases. I presume from the little of the code I've looked at that it does the same for the tables and indexes to reorganise.

HTH
  David
0
 
jogosCommented:
Guess it's hard-coded that your that this index is created, check the process that is creating your T-sql.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.