Debug the SQL script and studiosql from the application in Visual Studio
At lunch, my colleague asked me a question. Can I debug SQL scripts in? My answer is: yes !...... Right? :) Because the project property page shows the option to enable SQL Server debugging, but I have never called it that way, just do it? So simple? So... give me 5 minutes to tell you how many 5 minutes to tell you the answer :)
I tried it back, but it was not possible to hook it up. Then I searched for it ~ I will post the steps below, which is actually very simple.
Windows 7
Visual Studio 2010 SP1
Web SQL Server 2008 SP2
1. I created a test program and a test stored procedure.
2. Select enable SQL Server debugging on the properties page of the project]
3. Connect to the database in [server resource manager]. Note that the connection is authenticated using windows. Otherwise, an error will be reported when you check [Application debugging ].
4. Right-click the database to be debugged and select [Application debugging]
If you do not use windows authentication to connect to the database, an error will be reported when you select this option.
5. Next, you need to open the debugging stored procedure and set the breakpoint.
6. OK. You can debug it happily.
I can't write a document, but I 'd like to talk about it more :)