Using SQL Server 2005:
I have one stored proc that calls several others within it. One code segment, as an example, goes:
INSERT INTO Log (...) VALUES (A...)
EXECUTE StoredProcA params...
INSERT INTO Log (...) VALUES (A...)
INSERT INTO Log (...) VALUES (B...)
EXECUTE StoredProcB params...
INSERT INTO Log (...) VALUES (B...)
It appears that StoredProcB is executing before StoredProcA has completed execution. How can I ensure that A has finished before B starts?
The best solution that I can come up with right now is putting a call to B at the end of A. Any other ideas?