The Select Permission Was Denied on the Object 'Sysobjects', Database 'Mssqlsystemresource', Schema 'Sys'

The SELECT permission was denied on the object 'sysobjects', database 'mssqlsystemresource', schema 'sys'

This was a problem with the user having deny privileges as well; in my haste to grant permissions I basically gave the user everything. And deny was killing it. So as soon as I removed those permissions it worked.

Error - The SELECT permission was denied on the object 'sysobjects', database 'mssqlsystemresource', schema 'sys'

You execute this non-query: GRANT SELECT ON sys.sysobjects TO you; where you being the username. You can only do this as the admin(usually user sa)

The SELECT permission was denied on the object 'fn_dblog', database 'mssqlsystemresource', schema 'sys'

The required permission to use the fn_dblog system table-valued function is sysadmin role membership.

Importantly, this function is undocumented so it should not be used in application code, especially to update a table.

EDIT:

Your comment indicates the function is used in a trigger. You could create a certificate and certificate user that's a sysadmin role member as described here and then sign the trigger with that certificate. That will confer sysadmin permissions to the trigger code and allow non-sysadmin users to use the function but only in the context of the trigger.

I would normally include an example T-SQL script in my answer but I want to strongly discourage you from going down the path of using the undocumented system function in app code.

You have a classic XY problem that needs to be solved differently. Ask a new question about how to provide the functionality you need without using fn_dblog. Include your existing code in the question.

The SELECT permission was denied on the object 'Users', database 'XXX', schema 'dbo'

I think the problem is with the user having deny privileges. This error comes when the user which you have created does not have the sufficient privileges to access your tables in the database. Do grant the privilege to the user in order to get what you want.

GRANT the user specific permissions such as SELECT, INSERT, UPDATE and DELETE on tables in that database.

Permissions issue in SSMS: The SELECT permission was denied on the object 'extended_properties', database 'mssqlsystem_resource', ... Error 229)

Please check that you didn't check db_denydatareader DB role. By removing that check it worked for me.



Related Topics



Leave a reply



Submit