Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
509 views
in Technique[技术] by (71.8m points)

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

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 hit it when the sproc is called from an ASP.NET WebForms app in the same debugging session.

When following the same steps as for VS 2010, the breakpoints aren't hit inside the sproc.

Debugging T-SQL in a sproc on a SQL Server 2008 R2 Express database works as expected in Visual Studio 2010.

To be sure everything was enabled properly, I went over the instructions for VS 2010 (here), but no such page exists for VS 2012 or .NET 4.5.

It seems the missing step is to enable "Application Debugging", but no such option exists in the Server Explorer > Data Connections context menu in VS 2012.

VS 2010 Application Debugging

enter image description here

VS 2012 No Application Debugging

enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You need to open "SQL Server Object Explorer. Not "Server Explorer". That is what is different between 2010 & 2012. Then right click on the server and select "Application Debugging".


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...