Hi, i have a user in sql server database. I try drop user, but I get the follow error:
Error 15284 "The database principal has granted or denied permissions to objects in the database and cannot be dropped"
I Run the following query:
select
permission_name,
state_desc,
object_name(major_id) as securable,
user_name(grantor_principal_id) as grantor
from sys.database_permissions
where grantee_principal_id = user_id('PORTALWEB')
with 0 results.
Then run the following query:
select *
from sys.database_permissions
where grantor_principal_id = user_id ('PORTALWEB');
with the follow 18 results:
class class_desc | major_id | minor_id |
grantee_principal_id | grantor_principal_id |
type permission_name | state | state_desc
4 DATABASE_PRINCIPAL 7 0 5 7 AL ALTER D DENY
4 DATABASE_PRINCIPAL 7 0 5 7 CL CONTROL G GRANT
4 DATABASE_PRINCIPAL 7 0 5 7 VW VIEW DEFINITION G GRANT
. . .
(18 rows)
Then i run the following query:
REVOKE VIEW DEFINITION ON USER::PORTALWEB TO public
REVOKE CONTROL ON USER::PORTALWEB TO public
REVOKE ALTER ON USER::PORTALWEB TO public
But i run again
select *
from sys.database_permissions
where grantor_principal_id = user_id ('PORTALWEB');
shows me the 18 same records and i cant drop user PORTALWEB from my DB Please, any help?
Thanks!!!