removing a user

  • I was testing and created a user with the following code.

    sp_addlogin 'B6013','test'

    GO

    sp_defaultdb 'B6013', 'LAW_REPOSITORY'

    GO

    USE LAW_REPOSITORY

    go

    sp_grantlogin 'B013'

    go

    sp_grantdbaccess 'B6013'

    GO

    sp_addrolemember 'glreports', 'B6013'

    GO

    seemed to work fine but now I can't get rid of B6013.

    I get the message

    "Login 'B6013' is aliased or mapped to a user in one or more database(s). Drop the user or alias before dropping the login."

    The user is not in database LAW_REPOSITORY so I can't drop the user and there are no aliases.

    thanks

    David Weil

  • Run sp_droprolemember to remove 'B6013' from your 'glreports' role and then try to drop the login.

    If you still see errors, use sp_dropalias to remove the alias.

    Edited by - Allen_Cui on 06/13/2003 1:49:25 PM

  • It worked thank you

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

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