SQL Jobs

  • Comments posted to this topic are about the item SQL Jobs

    Thanks.

  • I created a job with only the command

    "Select getdate())" which has syntax error in it.

    The job failed. But,

    1. It created the file when it was not there.

    2. It updated the file when it was already there.

    :w00t:

  • i know the answer is straight away no since there is syntax error. :rolleyes:

    but clicked the answer "yes":crying: thinking that there might be any trick which i have missed

  • Hi,

    I think it will update the file even if it exists.

    I create a job with step than contains inser into t1 values(1) .

    the file in the output already exists, and updated with this message

    Msg 156, Sev 15, State 1, Line 1 : Incorrect syntax near the keyword 'into'. [SQLSTATE 42000]

  • Let's assume that there's no output file already there in the location.

    If the file is already available in the location, will it write anything to the file?

    Which is it? Is the file there or not?:unsure:


    Just because you're right doesn't mean everybody else is wrong.

  • Rune Bivrin (3/26/2015)


    Let's assume that there's no output file already there in the location.

    If the file is already available in the location, will it write anything to the file?

    Which is it? Is the file there or not?:unsure:

    I think this is the worst bad worded qotd!

    The output file is associated with the step and not with the job.

    If the step is executed the file is written, it doesn't matter if the file exists or not and if the step fails or successes.

    Only few cases in which SQL Agent couldn't write the output file:

    destination path doesn't exists (e.g. c:\temp\not_exists\step1.log)

    Account of SQL Agent doesn't have permission to write to destination (e.g. \\LOGSERVER\log\step.log)

    Disk full.

    The output file is already open in exclusive mode by another task/thread.

  • This question is somewhat badly worded.

    Not only was it confusing as to how the job steps are defined, but there appear to be two questions:

    Now if you run the job and if it fails, will it create the output file?

    If the file is already available in the location, will it write anything to the file?

    This follow up question makes it seem like the answer to the first question has to be yes.

    But if I understood the way the question is worded, the answer should be no.

    However if I misunderstood the first question, and the answer is yes, then it stands to reason that the answer to the second question is also yes.

    At which point I get confused, and end up answering yes.

  • Rune Bivrin (3/26/2015)


    Let's assume that there's no output file already there in the location.

    If the file is already available in the location, will it write anything to the file?

    Which is it? Is the file there or not?:unsure:

    +1 , Got the same doubt 😉

  • As pointed out by others, this isn't worded too well (Also the explanation is wrong - it's been tested with a syntax error in a job step and it does create/update a log file).

  • Question's answer is wrong, i.e. the right answer is Yes. There is no point the output file creation/content be depended of the any kind of errors present during job's execution.

    Igor Micev,My blog: www.igormicev.com

  • Joy Smith San (3/26/2015)


    I created a job with only the command

    "Select getdate())" which has syntax error in it.

    The job failed. But,

    1. It created the file when it was not there.

    2. It updated the file when it was already there.

    :w00t:

    Correct - the answer should be Yes.

    :hehe:

  • I have to agree with the others: this is a badly worded QOTD and it has an incorrect answer too.

    The answer should be yes.

    Please correct the answer and give everyone back their points in case they answered yes.

  • This was removed by the editor as SPAM

  • The wording seems clear to me, the output file referred to is one created for success/failure etc and not one created by a previous step.

  • Stewart "Arturius" Campbell (3/26/2015)


    If there is a Syntax error in the script to create a job, the job will not be created.

    Correct, so in that case you can't run the job. Since the question was "Now if you run the job and if it fails", it means that the job creation was successful, otherwise you can't run it.

Viewing 15 posts - 1 through 15 (of 37 total)

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