December 2013
Intermediate to advanced
1872 pages
153h 31m
English
When displaying the estimated execution plan for a stored procedure, you see multiple statement operators as inputs to the Stored Procedure operator, especially if you have any conditional branching in the stored procedure. One operator exists for each statement defined in the stored procedure. When conditional branching occurs in the stored procedure, SQL Server does not know at query optimization time which statements in the stored procedure will actually be executed, so it has to estimate a query plan for each individual statement. An example is shown in Figure 32.7.
FIGURE 32.7 Estimated execution plan for a stored ...