Last week I dropped a database without removing it from my maintenance plans first. Now the jobs are failing with an error message similar to the following:
Job 'Optimizations Job for DB Maintenance Plan 'Database Reindex (User)'' : Step 1, 'Database Reindex (User)' : Began Executing 2008-03-09 06:30:02
output
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
(null)
Microsoft (R) SQLMaint Utility (Unicode), Version 8.00.2039
Copyright (C) Microsoft Corporation, 1995 - 1998
(null)
Logged on to SQL Server 'ServerName'
as 'Domain\Account' (trusted)
(null)
[Microsoft SQL-DMO] Error 21776: [SQL-DMO]The name 'SERVICEDESK_20070823' was not found in the Databases collection. If the name is a qualified name, use [] to separate various parts of the name, and try again.
(null)
Msg 22029, Sev 16: sqlmaint.exe failed. [SQLSTATE 42000]
The database listed is the one I dropped. How can I fix this?
Thank-you,
Rubens
Adjusting the Maintenance Plan so it doesn't try to work against your database?

Signature
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
Last week I dropped a database without removing it from my maintenance plans first. Now the jobs
are failing with an error message similar to the following:
Job 'Optimizations Job for DB Maintenance Plan 'Database Reindex (User)'' : Step 1, 'Database
Reindex (User)' : Began Executing 2008-03-09 06:30:02
output
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
(null)
Microsoft (R) SQLMaint Utility (Unicode), Version 8.00.2039
Copyright (C) Microsoft Corporation, 1995 - 1998
(null)
Logged on to SQL Server 'ServerName'
as 'Domain\Account' (trusted)
(null)
[Microsoft SQL-DMO] Error 21776: [SQL-DMO]The name 'SERVICEDESK_20070823' was not found in the
Databases collection. If the name is a qualified name, use [] to separate various parts of the
name, and try again.
(null)
Msg 22029, Sev 16: sqlmaint.exe failed. [SQLSTATE 42000]
The database listed is the one I dropped. How can I fix this?
Thank-you,
Rubens
Rubens - 09 Mar 2008 19:22 GMT
Sorry, I should have mentioned I tried to do that. However, its not listed
as an available database in the maintenance plan because it is now dropped.
Is this a dreaded case where I might need to delete something from a system
table? Or should I maybe just create a database with the same name, add it
to the maintenance plans, remove it from the maintenance plans, then drop
that database?
Thank-you,
Rubens
> Adjusting the Maintenance Plan so it doesn't try to work against your
> database?
[quoted text clipped - 25 lines]
> Thank-you,
> Rubens
Tibor Karaszi - 09 Mar 2008 20:14 GMT
Ahh, I see. Hmm, yes, I'd try to add a new with same name, as per your suggestion.

Signature
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
> Sorry, I should have mentioned I tried to do that. However, its not listed as an available
> database in the maintenance plan because it is now dropped.
[quoted text clipped - 33 lines]
>> Thank-you,
>> Rubens
Rubens - 10 Mar 2008 14:49 GMT
I created the database and it was added to those maintenance plans
automatically. So I think this is going to work. I removed it from all
maintenance plans then dropped the database. However, I won't know for sure
until they next run this coming weekend.
Thank-you,
Rubens
> Ahh, I see. Hmm, yes, I'd try to add a new with same name, as per your
> suggestion.
[quoted text clipped - 42 lines]
>>> Thank-you,
>>> Rubens
Rubens - 19 Mar 2008 14:12 GMT
As a follow-up, this worked just fine.
Thanks,
Rubens
> I created the database and it was added to those maintenance plans
> automatically. So I think this is going to work. I removed it from all
[quoted text clipped - 50 lines]
>>>> Thank-you,
>>>> Rubens
Tibor Karaszi - 20 Mar 2008 07:42 GMT
Thanks for the follow-up, Rubens.

Signature
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
> As a follow-up, this worked just fine.
>
[quoted text clipped - 45 lines]
>>>>> Thank-you,
>>>>> Rubens