Hi
I have an [MSSQL Execute Query] object that query's a MSSQL server 2005 with the following script:
DECLARE @counter INT
SET @counter = 0
WHILE @counter = 0
BEGIN
SET @counter = 0
END
As you can see this is an indefinitely loop and i am looking for a way to stop it at a certain amount of time. I found the Query Timeout option and set it to 10 seconds, but it doesn't do a thing. The loop just keeps on going.
Any idea's how to stop the loop? Thx in advance.
Hi,
It looks their was a bug in the SQL Execute Query action which was preventing the timeout from taking effect, here is a new build of FinalBuilder which correctly sets the query timeout:
FinalBuilder 6: https://www.finalbuilder.com/downloads/finalbuilder/610/FB610_841.exe
or
FinalBuilder 5: https://www.finalbuilder.com/downloads/finalbuilder/550/FB550_750.exe
Regards,
Paul.
Hi again,
I downloaded and installed your build version 5, but the bug doesn't seem to be fixed. The loop just keeps on going and a time out never occurs. You are sure you tested it?
Thx
Hi,
The bug where FinalBuilder was not passing in the correct timeout option to the underlying tool (SqlCmd, oSql, iSql) has definitely been fixed in build 750, so it looks like using a query timeout doesn’t work when the queries in an infinite loop.
I’m not sure why you would need to run an ‘infinite loop’ query, but as a workaround, could you perhaps do something like this?
DECLARE @counter INT
SET @counter = 0
WHILE @counter < 10
BEGIN
SET @counter = @counter + 1
WaitFor Delay ‘00:00:01’
END
Normally we run another query, but sometimes that query gets in an infinity loop and to simulate this bigger query, i use a small loop. But i guess its time to try out the bigger query with a timeout value and see what happens.