SQL Server 2005

  • I have a user in a database (SQL Server 2005 version) and I have been trying to drop this user but could not. This is the error I am receiving from SQL Server.

    "

    Msg 15138, Level 16, State 1, Line 3

    The database principal owns a schema in the database, and cannot be dropped.

    I have check the database and the user does not own any object/s. How can I handle this issue?

  • as you said the user does not own any object then drop the schema with the name of the user under databases --> security -->schemas. This is the behaviour of the 2005 as it creates a schema with the name of the user.

     

  • with this query you could check which schema the user owns:

    select * from information_schema.schemata

    where schema_owner = 'user'

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

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