r4r4
r4r4

Reputation: 75

Need detailed instructions for debugging SQL Server stored procedure in Visual Studio 2019

I am a victim of the debugger having been removed in SSMS v18. You are now supposed to do it in Visual Studio 2019, but I am failing. I have read many webpages on the subject. For example:

Why aren't my breakpoints hitting SQL In Visual Studio 2019 debugging script from network server

How to: Debug a SQL Server CLR Integration stored procedure

How to debug SQL from Visual Studio 2019

What I try: here is the procedure:

CREATE PROCEDURE [dbo].[sp_DevTest]
AS
    DECLARE @dHrs decimal(12,4)

    SELECT @dHrs = dbo.TNPF_OperHours(592,'2020/10/31 23:59 -07:00')

    RETURN @dHrs

Its purpose is to test function dbo.TNPF_OperHours.

I set a breakpoint on the SELECT statement. From the SQL main menu item I click on 'Execute With Debugger'. The entire procedure is highlighted in yellow; the breakpoint disappears. I cannot set a breakpoint. I press F11. The yellow highlighted procedure disappears and I am back at the editing window with the breakpoint highlighted.

I thought maybe I need a SQL project in the solution. After creating one I could not find a way of debugging from there.

My development environment is a single Win 10 computer with this SQL Server installation:

SQL Server Installation

I use Visual Studio 2019 Community Edition. I develop websites for tiny non-profit organizations. I am retired and I donate my time. And I am stuck and would greatly appreciate your help.

Upvotes: 0

Views: 790

Answers (1)

Yitzhak Khabinsky
Yitzhak Khabinsky

Reputation: 22187

Just install the latest SSMS v.17.9.1 that supports inline debugging. It can coexist with SSMS 18.* on the same machine.

SSMS 17.9.1 download

Upvotes: 1

Related Questions