locked
debugging stored procedure in Visual studio 2019 RRS feed

  • Question

  • User351619809 posted

    I am trying to debug the stored procedure in Visual studio 2019. I have sysadmin rights on the server. These are the steps that I took in order to debug the stored procedure.

    1. opened the SQL server Object explorer
    2. Successfully connected to the server and opened the stored procedure
    3. Right click on the server and enabled application debugging
    4. opened the stored procedure and put the breakpoints inside the stored procedure.
    5. started my application and when I did return sqlCommand.ExecuteNonQuery(), nothing happened, the control did not pass to the stored procedure.

    I read few articles and everywhere it is saying that I need to right click on my project and open the properties window and check on "Enable sql server debugging" . I cannot find this option in Visual studio 2019. I am using SQLServer2019-x64 developer edition.

    Any help will be highly appreciated.

    Wednesday, March 24, 2021 12:54 AM

All replies

  • User-1038772411 posted

    Hello anjali,

    Check property window after enabling the SQL Server Object Explorer, you will find "Enable sql server debugging"option.
    After enabling also try to follow this steps for debugging SP in VS :- 

    https://www.codeproject.com/Articles/1079275/Debug-Stored-Procedures-in-Visual-Studio-and-SSMS

     

    Wednesday, March 24, 2021 6:46 AM
  • User-939850651 posted

    Hi anjaliagarwal5,

     

    I read few articles and everywhere it is saying that I need to right click on my project and open the properties window and check on "Enable sql server debugging" . I cannot find this option in Visual studio 2019. I am using SQLServer2019-x64 developer edition.

    According to your description, in the WebForms project, if you need to debug the Sql stored procedure, based on what you have done now, you also need to open the Sql Server Debugger.

    Right-click the project -> select Properties, and refer to this image below:

    Hope this can help.

    Best regards,

    Xudong Peng

    Wednesday, March 24, 2021 8:06 AM