SQL Server debug Stored Procedure from .NET code

心已入冬 提交于 2020-01-07 05:14:08

问题


I'm wondering if there's a way to debug a stored procedure at the time it's called from .NET code? What are my possibilities?

I'm using Visual Studio 2013 Community Edition and SQL Server 2014


回答1:


I have managed to figure it out myself.

It's quite similar to what you can find in VS 2010.

  1. I had to import database as a project to my solution.
  2. Turn on SQL Debugging in my application project properties.
  3. Re-open my project.
  4. Connect to my SQL Database through SQL Server Object Explorer.
  5. Right click on my SQL Server I connected to earlier and check "application debugging".
  6. Find SP I wanted to debug, double click on it, set my breakpoint (it says it will not be hit, but eventually it will).
  7. Launch my application using debugger.

Everything now works as expected, the debugger stops at my breakpoint with no problem.



来源:https://stackoverflow.com/questions/31267868/sql-server-debug-stored-procedure-from-net-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!