开发者

SQL-Server infinite loop

how does sql-server handle infi开发者_开发问答nite loops? Does it detect it or kill the server.

EG:

WHILE (@number = 3)
BEGIN
    print @number
END


It depends on the client command timeout.

By default, a .net app will abort in 30 seconds and SSMS will wait forever (timeout = zero)

By itself, the SQL Server engine has no concept of "OK, I've had enough"


try it :) no it does NOT detect them. it's simply treated as a long running transaction.

also any kind of loop is sign of truely bad sql coding practice

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜