Avatar of valmatic
valmatic
Flag for United States of America asked on

Is it necessary to include "BEGIN" and "END" statements in a SQL script?

Hi.  A programmer came in and helped us generate a lot of SQL code.  I'm a novice SQL user but I can follow along and decipher what steps are being performed so am reviewing to understand the general flow of the application better.  I noticed that in many places the programmer did not use BEGIN and END statements, while in other places, they are being used.  Is this just good syntax or are these statements required to perform some functions while others, not so much?  A couple of the Sprocs with these statements included are simply calling out table updates but same thing is happening in another sproc and the begin/end statement are not used.  thanks
Microsoft SQL Server

Avatar of undefined
Last Comment
valmatic

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Brian Crowe

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Jim Horn

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
D B

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
valmatic

ASKER
Thanks so much for the quick responses.  Exactly what I wanted to know for my own growing knowledge.  
Bishop, I know you said no points but it's just good form man..  Plus your insight is great.  :)
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23