After the stored procedure has been written, it is not certain that the requirements of the business logic are fully complied with and can be debugged to determine compliance. Debugging is available through Visual Studio, and there are three debugging methods in Visual Studio.
First, the database debugging directly.
Second, the application debugging.
Third, debug in the SQL Server project.
You can create a SQL Server project in Visual Studio. The project can contain T-SQL and database objects, and these database objects can be debugged through the SQL Server project itself.
This article briefly introduces the first method, and in the first method there are two different ways to debug the local and remote databases. Here is a brief introduction to the method of debugging stored procedures in the local database.
Debugging steps:
1. Open Visual Studio 2013, click View, and select Server Explorer.
2. Right click on "Data Connection" and select "Add Connection"
3. Select "Microsoft SQL Server" or "Microsoft SQL Server database File" in the Pop-up window
4, in the third step on the basis of configuration, this step according to the third step selection options, the content of the configuration is different, but are relatively simple, do not describe.
5. After adding the connection, click "Stored Procedure", select the stored procedure you want to debug, right click, select "Execute", and enter the corresponding parameter (if any) in the popup window.
6. Click the drop-down button to the right of the green button in the Open tab window and select "Execute with Debugger" to start debugging.
7, debugging, you can press F11 or F10 step or process into, debugging, debugging the mouse on the variable can see the value of the variable.
VS2015 debugging SQL Server stored Procedures