更新时间:2022-11-27 14:11:31
我将建立在Davide的答案和Ian对它的评论,因为那是
假设:答案基于 VS2008& VS2010
要调试.NET应用程序时,要跨SQL Server上的T-SQL存储过程,您需要执行以下操作:
按照MS支持说明 如何在Visual Studio .NET中调试存储过程(选项2)
启用允许SQL / CLR调试在存储过程调用的数据连接上:
从评论中添加:(这似乎是获取它的关键工作)
它与编程创建的连接一起工作。您只需使用右键单击服务器实例时显示的完全相同的连接字符串,单击属性,然后向下滚动到连接字符串(Verbindungszeichenfolge in German)。 p>
I am debugging some C# code that uses Ado.net to call a stored proc (TSQL) in SQL Server. How can I step into the stored proc?
(I think I have seen this demoed by Microsoft staff, but can’t recall the 101 "magic" settings that are needed to get it to work.)
I'll build on Davide's answer and Ian's comment to it because that was the exactly the process I have gone through.
Assumption: answer is based on VS2008 & VS2010.
To step through a T-SQL stored procedure on SQL Server while debugging a .NET app you need to do the following:
Follow the MS Support instructions "How to debug stored procedures in Visual Studio .NET (Option 2)"
Enable the Allow SQL/CLR Debugging on the Data Connection on which the stored procedure is called:
Added from comments: (This seem to be key to getting it to work)
It works with a programmatically created connection, too. You just have to use the exact same connection string that is displayed when you right-click the server instance, click on 'Properties' and scroll down to 'Connection string' (Verbindungszeichenfolge in German).