• Good question, but the explanation falls a bit short. I was very disappointed when I first saw this behaviour. A semicolon is a statement terminator and should be used after every statement - but apparently, END TRY is not considered a statement by this logic. So the semicolon after END TRY is not interpreted as terminating the END TRY, but as terminating a dummy, zero-length statement. (They exist. Try typing a bunch of semicolons and hit execute - it will complete without errors).

    In short - just after I had learned myself to consistently semicolon-terminate every statement, I now have to leanr myself NOT to do that for at least one statement (END TRY).


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/