How to debug SQL Server T-SQL in Visual Studio 2012

前端 未结 4 622
日久生厌
日久生厌 2020-12-09 18:02

How does one debug a T-SQL stored procedure in a multi-tier application in Visual Studio 2012?

To be clear, I want to set a breakpoint in a sproc in VS 2012, and hi

4条回答
  •  囚心锁ツ
    2020-12-09 18:40

    I believe the easiest way to do this would be to add DB as a project to your solution. You can do this by right clicking on the DB in the SQL Server Object Explorer (SSOX). This is a really good way to develop and debug your DB's. After you have added the DB to your project, you can add breakpoints anywhere you want, and debug against LocalDB (or another target if you wish). The largest drawback to this approach is that your existing data will not migrate with you (although you will be able to easily publish any changes back to the SQL DB at will). See the documentation on SSDT on MSDN for further guidance.

提交回复
热议问题