January 24, 2018 at 6:49 am
Hi,
I am doing some Q/A work where I am executing a ob that I need to fail - after 10 seconds.
I am running this and it does fail - but it fails in one second:
WAITFOR DELAY '00:00:10'
select top (100) * from sysjobs
WAITFOR DELAY '00:00:10'
select blah
Any ideas
January 24, 2018 at 7:06 am
krypto69 - Wednesday, January 24, 2018 6:49 AMHi,I am doing some Q/A work where I am executing a ob that I need to fail - after 10 seconds.
I am running this and it does fail - but it fails in one second:
WAITFOR DELAY '00:00:10'
select top (100) * from sysjobs
WAITFOR DELAY '00:00:10'
select blah
Any ideas
Try putting a 'GO' after your WAITFOR DELAY.
January 24, 2018 at 7:12 am
WAITFOR DELAY '00:00:10';
SELECT 1/0;
Yours fails instantly because the last query throws a parsing error, and the batch is parsed before any part of it starts executing.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 24, 2018 at 7:26 am
GilaMonster - Wednesday, January 24, 2018 7:12 AMWAITFOR DELAY '00:00:10';
SELECT 1/0;Yours fails instantly because the last query throws a parsing error, and the batch is parsed before any part of it starts executing.
Ahh..thanks Gail
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy