How do I add breakpoints to a stored SQL Procedure for debugging?

23,967

Solution 1

Actually, if you have SQL Server 2008, you can once again debug in Management Studio.

Each of these articles will take you through it step by step, with screenshots. It could hardly be easier.

SQL Server 2008: The Debugger is back

T-SQL Debugger is back in SQL Server 2008 ... debugging now made easy

New Features in SQL Server 2008 Management Studio

Solution 2

Follow these tutorials:

Debugging Stored Procedures in SQL Server 2005

Debugging SQL Server CLR functions, triggers and stored procedures

Share:
23,967
Raven Dreamer
Author by

Raven Dreamer

Follow my hobby development at: https://storm-shark.itch.io/

Updated on May 12, 2020

Comments

  • Raven Dreamer
    Raven Dreamer about 4 years

    I am trying to debug a SQL procedure, and am using the following query to do so.

    USE [database]
    GO
    
    DECLARE @return_value int
    
    EXEC    @return_value = [dbo].[Populate]
            @ssId = 201
    
    SELECT  'Return Value' = @return_value
    
    GO
    

    The problem is, the procedure I am testing, (Populate) doesn't seem to stop at any of the breakpoints I assign to it. Is there a different way to add breakpoints such that I can follow the debugger? I am getting the following error: "Invalid line number specified with SQL breakpoint".

  • ooXei1sh
    ooXei1sh over 3 years
    "This feature works with SSMS version 17.9.1 and earlier. run-the-transact-sql-debugger