Execute With Debugger starts T-SQL execution under interactive control, pausing at the first statement so you can inspect and advance through procedure logic. section 7.3
Mistake: trusting the error line
Running dbo.CalculateCampaignSummary produces a divide-by-zero error. Start it with Execute With Debugger, choose Step Into, and inspect variables in Locals. The zero value of @AvgCPM reveals the immediate cause; an Immediate-window query then shows that 42 rows were assigned where one was expected. section 7.3
Use the debugger to:
- Run diagnostic queries without pausing execution in the Immediate window. section 7.3
