question

kevini59 avatar image
kevini59 asked

The EXECUTE permission was denied on the object 'sp_enable_sql_debug', database 'mssqlsystemresource', schema 'sys'. (Microsoft SQL Server, Error: 300)

I have a developer which is attempting to Debug a SQL against a SQL Server 2014 database. They have db_owner rights to the particular DB but only public rights to the server in general. This is to isolate the developer from other databases which our security policy doesn't allow general access to. I believe, from what I have read, for earlier versions of the database, that in order to use Debugging, the developer requires to a sysAdmin on the server. Is this still true for SQL 2014 and, if so, is there anyway around this issue? I can't believe we are the only company that is experiencing this.
securitysql2014
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

anthony.green avatar image
anthony.green answered
No still to this day you need SysAdmin rights to run the debugger. This has been a debate in many an organization where I have worked even to give developers SA rights even in development environments incase they make a change to the server and thus never gets into production etc. So it was only granted at specific times they needed to run the debugger and that was only in dev, they never got it in any other environment.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

encotrio avatar image
encotrio answered

Hello,

User has not permission to run “sp_enable_sql_debug” stored procedure in mssqlsystemresource database. If you are database admin then you need to give permission to the user performing the execution like below.

use [mssqlsystemresource]

GO
GRANT EXECUTE ON [dbo].[sp_enable_sql_debug] TO [UserYY]

Change [UserYY] with your user.

Check more instruction here.

You can also use other method by create a new database role

Thnx

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.