Options

Error Deleting a Login

b2amolb2amol Member Posts: 64
Hi,

I am getting error on deleting any login from NAV.

The following SQL Server error or errors occurred:

15138,"42000",[Microsoft][ODBC SQL Server Driver][SQL Server]The database principal owns a schema in the database, and cannot be dropped.

SQL:
{CALL [sp_revokedbaccess](?)}

Database owner is SA

Security Model is Standard


Thanks,
Amol

Comments

  • Options
    GRIZZLYGRIZZLY Member Posts: 127
    You should previously delete Schema with the name of user from SQL server, then you could delete login.
    Btw, I thought Schema creates only when Security set to Enhanced.
    Sincerely yours, GRIZZLY
    Follow my blog at http://x-dynamics.blogspot.com
  • Options
    krikikriki Member, Moderator Posts: 9,098
    Use SSMS and go to your database=>Security=>schemas.

    In there search the user you want to delete.
    If you are on SQL2008, you can position on menuitem "schemas" and hit F7 to have a list of the schema's and their owners. If you are on SQL2005 your probably have to check which schema's belong to the user you want to delete.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Options
    b2amolb2amol Member Posts: 64
    Thank you for your reply.

    My intention was to add a user, and i got this error. That made me believe that NAV is trying to drop orphaned users.
    I already did clean up by dropping orphaned users in SQL, using SSMS.
    However two SID's show up in my NAV users list. So as of now users can neither be added or deleted.

    this is a test box, so i guess it is best to recover back from prod again.

    Amol
  • Options
    krikikriki Member, Moderator Posts: 9,098
    Use SSMS anyway, go to the Windows user table and delete its user from there.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Options
    KishraguKishragu Member Posts: 45
    Hi B2amol,

    We recently faced this error in one of our recent implementations and we found out the login which was missing within SQL and re-created this login within SSMS. After adding this missing login, we were able to add / remove users as normal.

    Probably not the cleanest of the solutions but it worked for us!!

    Cheers,
    Kishore
Sign In or Register to comment.