Symptoms

The task to drop database user fails with the following output:

Destination host 'mpf.hosting.local' (#19), IP '10.10.10.10' : Provisioning request failed. IDispatch error #3092 [<response><errorContext description="The database principal owns a database role and cannot be dropped." code="0x80040e14" executeSeqNo="2"><errorSource namespace="SQL Provider" procedure="ExecSQL"/></errorContext></response>]

Cause

Microsoft SQL server cannot drop user if it owns schema or role.

Resolution

In order to fix the issue you need to change the owner of database in question from MSSQL DB server Database > Security > Roles > Database Roles;

If user own database scheme, you may use the following query executed on target Microsoft SQL server:

ALTER AUTHORIZATION ON SCHEMA::%user_name% TO dbo;

Note: specify problematic user name in query above instead of %user_name%.

Internal content