DROP LOGIN

  • ravisamigo

    SSCertifiable

    Points: 7440

    Dear All,

    Could you please advise on the below error.

    Msg 15174, Level 16, State 1, Line 1

    Login 'abcd' owns one or more database(s). Change the owner of the database(s) before dropping the login.

    I have changed the db_owner to 'xxxx' for all databases by using

    EXEC sp_changedbowner 'xxxx' and tried to drop the login 'abcd' still Iam facing the above error.

    Thanks in advance,

    Regards,

    Ravichandra.

  • ravisamigo

    SSCertifiable

    Points: 7440

    Any one help me out from this? please

    Regards,

    Ravichandra.

  • crazy4sql

    SSCoach

    Points: 19590

    run this...

    select name [database], suser_sname(sid) [owner] from master.dbo.sysdatabases

    what it says? If still seeing the owner as your problamatic username then change it.

    ----------
    Ashish

  • ravisamigo

    SSCertifiable

    Points: 7440

    Thanks Ashish !!! You are right.

    Actually, One database was in offline and also it mapped to old login 'abcd' which I couldn't noticed.

    I came to know once I ran a query which you sent to me.

    Now,Iam able to delete.

    Once again thanks !!

    Regards,

    Ravichandra.

  • Miguel Angel Zavala Vizcaya-410089

    SSC Enthusiast

    Points: 163

    Thanks a lot

Viewing 5 posts - 1 through 5 (of 5 total)

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