This is a really dumb question, that I just realized I do not know the answer to.Inside of a stored procedure, The use of Begin and end is required for numourus things, but is it required in this situationLets say I have two procudres, one of which must run before the secondexec SP_MustRunFirstAndCompleteExec SP_RunsSecond--should id be this?Beginexec SP_MustRunFirstAndCompleteEndBeginExec SP_RunsSecondEnd
Is there any need for a begin end in this scenerio, or does sql know it must complete the first procedure before it starts the second on it's own?also the same question with two queries--Must run and Complete before the updateInsert into TBl1(Column123)select colum123from tbl2--First query must be done in full before this runs.Update Tbl1(Column123)set Column999 = 12345
Do I need Begin and ends in any of these scenerios? and if I do, would I write it like soBEGIN--Must run and Complete before the updateInsert into TBl1(Column123)select colum123from tbl2--First query must be done in full before this runs.Update Tbl1(Column123)set Column999 = 12345END--orBEGIN--Must run and Complete before the updateInsert into TBl1(Column123)select colum123from tbl2ENDBEGIN--First query must be done in full before this runs.Update Tbl1(Column123)set Column999 = 12345END
Thanks a lot for the clarification