I was trying to drop a user from SSIDB database and I encountered the following error -
The database principal has granted or denied permission to catalog objects in the database and cannot be dropped. The transaction ended in the trigger. The batch has been aborted. (Microsoft SQL Server, Error: 27226)
I ran the following query to find the permission of the user I am trying to drop
use SSISDB
GO
SELECT TOP 1000 [object_type]
,[object_id]
,[principal_id]
,[permission_type]
,[is_deny]
,[grantor_id]
, 'EXEC catalog.revoke_permission @object_type=' + CAST([object_type] AS VARCHAR)
+ ', @object_id=' + CAST([object_id] AS VARCHAR)
+ ', @principal_id=' + CAST(principal_id AS VARCHAR)
+ ', @permission_type=' + CAST(permission_type AS VARCHAR) [execute this]
FROM [SSISDB].[catalog].[explicit_object_permissions]
WHERE principal_id = USER_ID('usertodrop')
Then copied the contents of the [execute this] column in a new query window and executed it against the SSISDB database which revokes the permission .
Then I was able to drop the user.
This blog is created to add all the information and experiences that I have learnt while working on MS sql server as a DBA. The blog is also updated frequently with the real world problem that I encounter hands on at work and the resolutions to resolve them. I hope this blog will be of some use to you and you will revisit. Thank you for stopping by and you are welcome to leave comments.
Showing posts with label explicit_object_permission. Show all posts
Showing posts with label explicit_object_permission. Show all posts
Friday, February 19, 2016
Subscribe to:
Posts (Atom)