7

I need to debug stored procedure on the local SQL Server using data stored in this server.

I have on my device:

  • Microsoft SQL Server 2017 Standard
  • Microsoft SQL Server Management Studio 2014
  • Microsoft SQL Server Management Studio 18.0 Preview 5
  • Visual Studio 2017 Professional

Debugger was removed from SSMS 17.9 and newer.

Attempt 1. Debug usign SSMS 2014. I got following error messages:

enter image description here

Unable to start program 'MSSQL:://localhost/MyDB/sys/=0'.

Same error for stored procedures that have no parameters.

Attempt 2. Debug using Visual Studio.

I can execute stored procedures and even change them on the SQL server side via VS.

But similar errors when I try to debug:

Failed to start debugger. An exception was generated: 'Data is Null. This method or property cannot be called on Null values.'

Unable to start program 'MSSQL:://localhost/?/sys/=0'. Operation not supported. Unknown error: 0x80004005.

So how am I supposed to debug stored procedures in Microsoft SQL Server 2017?

Or am I doing something wrong?

InfernumDeus
  • 1,185
  • 1
  • 11
  • 33
  • is your ssms service turned on; on this localhost of yours. – junketsu Dec 03 '18 at 14:55
  • It sounds like debugging is gone from new SSMS.. if you can’t find an older version may be it’s time to switch to another IDE https://sqlserver.miraheze.org/wiki/The_Ideal_IDE – estinamir Dec 03 '18 at 15:04
  • @junketsu what do you mean by ssms service? Can't find anything similar in my services. – InfernumDeus Dec 03 '18 at 15:31

1 Answers1

3

You don't have to go all the way back to SSMS 2014. SSMS 17.8.1 is still available for download.

Or you can use SQL Server Data Tools in Visual Studio to debug.

How to: Debug Stored Procedures

David Browne - Microsoft
  • 80,331
  • 6
  • 39
  • 67
  • "Debug Procedure...." and "Execute with Debugger" does **not appear** in my SSMS (V18.3.1). Also, I cannot set break points. What can I do to enable it? – Matt Dec 04 '19 at 12:23
  • I am currently evaluating the option specified [here.](https://dba.stackexchange.com/questions/221349/how-to-add-the-debug-button-to-ssms-v18) – Matt Dec 04 '19 at 12:33