Error: Transact-SQL execution ended without debugging

Note

This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

This error occurs when you are trying to debug a Transact-SQL or SQLCLR procedure and the debugger does not receive debugging messages from the SQL Server.

This could be due to network problems or to problems on the SQL Server, but the most likely cause is a permissions problem.

There are two accounts involved:

  • The application account is the user account that Visual Studio is running as.

  • The connection account is the identity used to make the connection to SQL Server. This is not necessarily the same as the identity that Visual Studio is running as if the connection is using SQL authentication.

    SQL debugging requires that the application account must match the connection account or be sysadmin.

    If you are using a SQL login like sa, the application account must be setup on the SQL Server as a sysadmin. By default, administrators on the machine SQL server is running on are SQL Server sysadmins.

    To correct this error, you might need to:

  • Verify your permissions settings. For more information, see How to: Set SQL Server Permissions for Debugging.

  • Make sure SQL debugging if set up correctly.

  • Consult with your network or database administrator.

See Also

Setting Up SQL Debugging
How to: Set SQL Server Permissions for Debugging
Debugger Settings and Preparation
Remote Debugging