Having trouble deleting a user login

  • Hi,

    I am trying to delete a user from the database security section, but i am getting the the following error:

    The database principal owns a schema in the database, and cannot be dropped. (Microsoft SQL Server, Error: 15138)

    I was able to delete them in the main security area but not in the database section.

    I looked this up and found somethings on the line, but either I am doing something wrong or it is not matching what they are saying.

    Can someone please tell me how I can do this?

    Thank you

  • In Object Explorer - open the Schema section under Security for that database.  In that section you will see a list of schemas - now in Object Explorer Details look at the owner of each schema.

    One or more of those schemas are owned by the user you are trying to delete.  You cannot delete a user when that user owns objects in the database - you have to reassign ownership to another user - or remove those objects.

    Once you have identified the schema, then you need to check for other objects that are owned by that schema.  If there are tables/views/procedures/functions/etc... owned by the schema then you either need to delete those objects, change those objects schema, or change the ownership of the schema.

    Jeffrey Williams
    Problems are opportunities brilliantly disguised as insurmountable obstacles.

    How to post questions to get better answers faster
    Managing Transaction Logs

  • This worked and was much easier and easy to understand, far beyond anything else that read.

    Thank you

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply