• Andy Warren - Thursday, March 14, 2019 6:49 AM

    The begin/end optional (usually) syntax makes me crazy. I only use it when required, it just adds noise. Also a plug for set xact_abort on as a default in procs, too many people don't understand the behavior of transactions and errors/

    I think it's useful, because you might create a procedure with 15 parameters, and there's that group of definitions and default values you have to read through before you start the actual procedure code. (not to mention any header comments, USE statements up front, settings you're modifying, etc.). Gives you a clear start/end for where the actual work is being done.

    I'm assuming you're also only talking about the starting BEGIN and ending END around the whole procedure. Using BEGIN/END within a procedure to delineate sections of the code is VERY useful IMHO, especially because when connected, I can expand/collapse those BEGIN/END sections at will and only stare at the code I'm trying to fix, not slog through the whole thing top to bottom.

    -------------------------------------------------------------------------------------------------------------------------------------
    Please follow Best Practices For Posting On Forums to receive quicker and higher quality responses