SQL: Maintenance Plan Error “Server: Msg 22029, Level 16, State 1, Line 0 sqlmaint.exe failed.”

Earlier today, I discovered that the database maintenance plan on one of our SQL Server machine wasn’t working. When I reviewed the logs, it simply said “sqlmaint.exe failed”.

I ran the following command (copied from the SQL Server Agent job) using Query Analyzer (as this was a SQL Server 2000 machine):

EXECUTE master.dbo.xp_sqlmaint N'-PlanID C009A320-69FF-48D6-AC76-74292CD765AF -Rpt "E:\BackupDatabases\Backups4.txt" -WriteHistory  -VrfyBackup -BkUpOnlyIfClean -CkDB  -BkUpMedia DISK -BkUpDB "E:\BackupDatabases" -DelBkUps 2WEEKS -CrBkSubDir -BkExt "BAK"'

The error returned, was:

(5 row(s) affected)

Server: Msg 22029, Level 16, State 1, Line 0
sqlmaint.exe failed.

I tried running exactly the same command through the command-line:

CD \Program Files\Microsoft SQL Server\MSSQL\Binn

sqlmaint -PlanID C009A320-69FF-48D6-AC76-74292CD765AF -Rpt "E:\BackupDatabases\Backups4.txt" -WriteHistory  -VrfyBackup -BkUpOnlyIfClean -CkDB  -BkUpMedia DISK -BkUpDB "E:\BackupDatabases" -DelBkUps 2WEEKS -CrBkSubDir -BkExt "BAK"

This worked!!!

Both the SQL Server service, and the SQL Server Agent are using the Local Service account.

I have asked our server hosting provider to restart the server, as I have tried restarting the services, but still the maintenance plan doesn’t work through SQL Server Agent.

I shall update this post once the server has been restarted.

1 Comment

Add a Comment
  1. Hi.

    The server was rebooted overnight, and I can confirm that the maintenance plan jobs are now working.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.