Mathew Sok
Mathew Sok

Reputation: 163

Debugging SQL in SSMS v18.0+

I've just installed SSMS v18.6 and surprisingly I noticed that there's no debug menu anymore! I'm very dependent on debugging my SQL scripts like stored procs. Can anyone explain how I can achieve this? Any help would be much appreciated.

Upvotes: 16

Views: 22894

Answers (3)

Rene Vliex
Rene Vliex

Reputation: 11

Sometimes you can debug using and older version of SSMS (like 2014) that still has the debug feature build in. I haven't tested though for what newer SQL Server versions this still works. I'm having problem using Visual Studio for debugging if there are nested stored procedures. It starts asking for the source-code when it returns to the caller procedure. So unfortunately they took away debugging and in return we got an alternative that has bugs.

Upvotes: 0

Mehdi Hassani Goodarzi
Mehdi Hassani Goodarzi

Reputation: 157

You can debug the SQL Server stored procedure and scripts with Visual Studio.NET,

  1. Open the Visual Studio.NET and click the continue without code (link)

  2. Connect to SQLServer in Visual Studio.NET. Menu Tools->SQL Server->New Query

  3. Enter Sql Server Connection Data

  4. In script note write your script or Invoke the Stored procedure or User define function

  5. F9 or double click left of code line for out the break point

  6. In menu SQL-> Execute with debugger

  7. with F11 trace line By line

  8. Complete

enter image description here

Upvotes: 8

Roozbeh Y Shad
Roozbeh Y Shad

Reputation: 156

Debugging capabilities are no longer available in SSMS v18.0 onwards. I guess it's not been in high demand and also because of the overload it has imposed on the software. If you still need to debug your SQL scripts you can do it by using Visual Studio. There is a good video at How to debug SQL code showing you how to achieve your goal.

Upvotes: 14

Related Questions