Limit on number of nested IF statements
According to this Microsoft Docs page, nesting of IF statements is dependent on available memory.

On my test workstation, I was able to write and execute this, which is 189 levels deep:

declare @teste int;
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
IF (1=2) BEGIN SET @teste = 1 END ELSE
print 1


189 levels of nesting seems pretty bizarre to me, but then this is a bizarro world, lately.