liveBook · Manning

Step Into

As explained in 100 SQL Server Mistakes and How to Avoid Them

Step Into is a debugger command that advances execution into the next statement or called routine.

Step Into advances execution one statement at a time and enters every called procedure or function, pausing at its first statement. Use F11 when the error may be inside a lower-level routine. section 7.3

Tracing a divide-by-zero error

Execute dbo.CalculateCampaignSummary with the debugger, then press F11. Watch parameters and variables change in the Locals window. Stepping to the calculation reveals that @AvgCPM is zero before @AvgBidPrice is divided by it. Use the Immediate window to count matching aggregate rows and investigate why the query returns 42 rows. section 7.3

Table 7.1 Code debugging navigation options (view table figure)

Option

Shortcut

Description

Continue

F5

Continue execution until the next breakpoint.*

Step Over

F10

Will step through the top layer of code but continue through lower levels, such as procedures or functions, without debugging them (unless a breakpoint is hit)*

Step Into

F11

Will step through all layers of code. When a procedure or function is encountered, it will step into that code block and pause execution at the first statement.

* Discussed shortly

Compare Step Into with Continue and Step Over, including their keyboard shortcuts and treatment of called procedures. section 7.3

How 100 SQL Server Mistakes and How to Avoid Them covers it

How deep it goes
Defines all-layer stepping, then follows variables and diagnostic queries to the cause of a divide-by-zero error.
Examples
Demonstrates F11 with CalculateCampaignSummary, Locals inspection, and an Immediate-window row count.
What it assumes
Assumes a runnable stored procedure and basic query execution; teaches navigation from the debugger's paused first statement.
What you can do after
Diagnose divide-by-zero errors by stepping into procedures, inspecting variables, and querying data during paused execution.
How it connects
Connects debugging with breakpoints, Step Over, Continue, Locals window, Immediate window, stored procedures, and runtime errors.

Also explained in

Compare how 4 books explain Step Into →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of 100 SQL Server Mistakes and How to Avoid Them. The section links point to the parts of the book it draws on.