SQL2005 - Maintenance Plan - Backup - TSQL - Failure

  • Hi all,

    Im trying to run a maintenance plan which backs up a file to a location.. i am using the following code

    --

    USE MASTER

    BACKUP DATABASE AM

    TO DISK = 'D:\Database\Backup\AM\AM_backup_For_Test.bak'

    WITH FORMAT;

    GO

    --

    This works fine in the studio as an SQL query

    but trying to execute this as a TSQL task in a maintenance plan (no other items) fails

    2 questions i guess

    a) Why doesn't this work in maintenance plan ? ( i dont want to use a backup task as i want a fixed name for the backup file.

    b) how can i get more info on the error other than what is reported:

    TITLE: Execute Maintenance Plan

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

    Execution failed. See the maintenance plan and SQL Server Agent job history logs for details.

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

    ADDITIONAL INFORMATION:

    Job 'AM-DBRestoreTesting.AM-DBRestoreTesting' failed. (SqlManagerUI)

    SQl Server Agent job history doesnt show anything and i cant see how to access the maintenance plan.

    Update: It is a syntax error, but i cant see what the issue is. (i found the maintenance plan logs yay!)

    Cheers

    ads


    ------------------------------
    Life is far too important to be taken seriously

  • Create a (sql agent) job where to add your backup code as a job step, then schedule the job; forget about maintenance plan if you want to run your own script.

    Good luck

     

  • that makes sense..ill give it a shot

    EDIT -> Worked Thanks..Strange that the Job created by the maintenance plan did not work if i tried to execute it itself.

    thanks !


    ------------------------------
    Life is far too important to be taken seriously

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply