How to debug store procedure when program run from visual studio 2013 RRS feed

  • Question

  • User828542847 posted

    i am using visual studio 2013 and often set break point on code when call store procedure. when we are passing data to store proc that we can debug from IDE but some time we need to debug store proc from VS IDE 2013. so please tell me way out to debug store proc from VS2013 IDE when we pass data from my program to store proc.

    need step by step details. thanks

    Thursday, August 31, 2017 9:44 AM


  • User347430248 posted

    Hi tapan2017,

    you can try to follow the steps below.

    Open Server Explorer.
    NOTE: It is not necessary to add a Data Connection to work with a SQL Server server because SQL Server servers are listed under the Servers node also. You will use the Servers node in the steps that follow; however, you can use a Data Connection to you SQL Server server in the same way.

    • Under the Servers node in Server Explorer, expand the SQL Server machine name, expand the SQL Servers node, expand the SQL Server instance, expand the Northwind database node, and then expand the stored procedures node.
    • Right-click the CustOrderHist stored procedure and then click Step Into Stored Procedure.
    • The Run stored procedure dialog box opens, which lists the parameters of the stored procedure. Type ALFKI as the value for the @CustomerID input parameter and then click OK.
    • In the Visual Studio design environment, a window opens that displays the text of the stored procedure. The first executable line of the stored procedure is highlighted. Press F11 to step through the stored procedure to completion.
    • In the Output window, the following message is displayed, which indicates successful execution:
      The program 'SQL Debugger: T-SQL' has exited with code 0 (0x0).


    How to debug stored procedures in Visual Studio .NET

    other useful links:

    Debug SQL Server 2012 Stored Procedure in Visual Studio 2013, Step by Step

    Debug Stored Procedures in Visual Studio and SSMS



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, September 1, 2017 2:45 AM