Search code examples
sql-serverlinuxdebuggingvisual-studio-2022

Debug SQL Server on Ubuntu 22 from Visual Studio 2022 fails


I run MSSQL on a Ubuntu 22 machine in the same network. I can connect from SSMS to the database and I can execute queries from VS 2022 on that database. So I guess it is no user or firewall issue. Only if I try to debug some stored procedure (which I regularly do on my Windows localhost) I get this

enter image description here
and this

enter image description here

Has anybody an answer to that? Thanks.

BTW: I searched the web but found no appropriate answer. PS: I also tried this from an old SSMS 17.9 with integrated debugger and the "Debug" butto is disabled. Maybe the linux server does not allow debugging?


Solution

  • Are you using SQL Server Data Tools in Visual Studio to debug your stored procedure?

    If not, please try to use SSDT to debug stored procedures to see if the issue persists.

    Please check the following steps:

    1.Connecting to the SQL Server Instance

    Please connect to the SQL Server instance running on Ubuntu 22 with SQL Server Management Studio (SSMS).

    2 Debugging SQL Queries in Visual Studio 2022

    (1) Open Visual Studio 2022 and create a Database project.

    (2) In Solution Explorer, right-click the project and select Add, then Stored Procedure and click Add.

    (3) Set breakpoints in the SQL query as needed.

    (4) Start the debugger by clicking the "Start" button in the toolbar Execute the SQL query in the debugger.

    The debugger will stop at the breakpoints, allowing you to inspect the state of the query and make any necessary changes.

    For more information, please refer to doc:How to Debug Stored Procedures

    Hope it can help you.