T-SQL infinite loop

you can prevent store procedure infinite loops by wrapping the code between BEGIN and END

i.e

CREATE PROCEDURE LoopCheck AS
DECLARE @i int
SET @i = 0
WHILE @i < 1
BEGIN -- Start
PRINT @i
SET @i = @i + 1
END -- END
RETURN

EXEC LoopCheck