EM90210
EM90210

Reputation: 145

When executing more than one stored procedures manually in sql, does it run them sequentially?

From top to bottom?

example:

exec storedprocedure1
exec storedprocedure2
exec storedprocedure3

If I hightlight all three and execute, does it run #1 first, then #2, #3?

Upvotes: 0

Views: 28

Answers (2)

jradich1234
jradich1234

Reputation: 1425

If you are using SQL Server and highlighting in SSMS then, Yes.

Upvotes: 0

Gordon Linoff
Gordon Linoff

Reputation: 1271151

The statements are executed in order. One statement does not run until the preceding one is completed. If one statement generates an error then (in general) the script will abort with an error (or go to an error handler at a higher level).

This is standard in scripting languages. The alternative would be parallel execution, which would generally require a multi-threading interface. This is possible in databases, because they are generally multi-threaded anyway. However, it is not the default for SQL nor for any other scripting language (to my knowledge).

Upvotes: 1

Related Questions