How to drop a user?

  • I'm trying to drop a user but I'm getting "The database principal owns a schema in the database, and cannot be dropped.(Microsoft SQL Server, Error:15138)"

    I deleted the schema and the login but for some reason I'm not able to delete the user.

    When I checked the properties of the user, it was still pointing to the schema that I dropped, so i used ALTER USER tsql command to point it to dbo schema and then tried to drop it but still doesn't work.

    Is there a way to drop the user?

    Thanks,

    Sunny.

  • Are you sure the schema was dropped?

    Are there any tables or objects in the database using that schema?

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • a user owning a schema cant be dropped until

    you delete all the tables,objects linked with the schema.

    Using the GUI in "Object Explorer" (MS SQL Management Studio) Expand the [databasename] / Security.

    Click on Schemas.

    In summary window, determine which Schema(s) are owned by the user and either change the owner or remove the Scheme(s).

    The user can then be deleted.

    Regards,

    Sushant

    Regards
    Sushant Kumar
    MCTS,MCP

  • SKYBVI (9/13/2010)


    a user owning a schema cant be dropped until

    you delete all the tables,objects linked with the schema.

    Using the GUI in "Object Explorer" (MS SQL Management Studio) Expand the [databasename] / Security.

    Click on Schemas.

    In summary window, determine which Schema(s) are owned by the user and either change the owner or remove the Scheme(s).

    The user can then be deleted.

    Regards,

    Sushant

    I wouldn't go so far as to say that the table needs to be deleted. Rather, the table needs to be re-assigned to a different schema.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

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

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