Backup log works in query Analyser But not in Job

  • I have a job that runs the following code:

    backup log "DDT-20071007" with truncate_only

    (Please note this is a development server and I am aware of the issues surrounding issuing a truncate only statement.)

    It Errors out with the following information:

    Incorrect syntax near 'DDT-20071007'. [SQLSTATE 42000] (Error 102) Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. [SQLSTATE 42000]

    This code runs fine in the query analyser,but fails when incorporated into a job. It has to have the quotation marks or it fails in the query analyser. There is no issue with permissions, can anyone help?

  • In QA the setting "Quoted Identifiers" is by default on.

    In SSMS (or EM) this setting is by default off. SO in your job either enbale quoted identifiers or remove the doublequotes.

    [font="Verdana"]Markus Bohse[/font]

  • You can run this query using brackets as -

    backup log [DDT-20071007] with truncate_only

    Hope it will work.

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

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