Hi we run 2014 standard. I'd like for my sql agent job's 2nd step to simply delay the job ending for about 5 minutes so i can test the concurrency logic i placed in step 1.
I would test that logic if i could submit the job again while the first one is running.
I used the waitfor syntax in step 2 two different ways as shown below but 1st job just finishes immediately. Thus preventing a good test.
Am I missing something? How can I get step 2 to really wait for five minutes? sorry for putting both command on the same line but i couldn't paste for some reason into the code box and when i hit enter from within the code box, control jumped outside of the code box.
waitfor delay '00:05:00' select 1 waitfor time '07:30' select 1
Answer by db042190 ·
A little embarrassed but my 1st step had the wrong setting for what to do on completion. So the waitfor is working.
From what i'm seeing sql stops you immediately from trying to execute a second instance. So you dong need concurrency logic to handle that. Pls let me know if this is a valid conclusion.