Public Role

  • I've deleted all the id's of my SQL server with the exception of a few. There are currently 4 databases. Some of the id's I deleted are still being displayed within the Public Role on a couple of the databases. When I highlight them the remove does not become active. Is there another way to remove them?

  • In Query Analyzer you can use the system stored procedure sp_droprolemember. For instance:

    EXEC sp_droprolemember 'public', 'UserToRemove'

     

    K. Brian Kelley
    @kbriankelley

  • I did as you suggested and got the following:

    Membership of the public role cannot be changed.

    Is there possibly another way to this?

  • Disregard that. Too early in the morning.

    The error message is exactly right. You can't remove anyone from the public role. All users are members of the public role if they have access to the database. You want to remove access to the database for the given user. Use sp_revokedbaccess and this should remove the user (which will in turn remove it from the public role).

    For instance:

    sp_revokedbaccess 'OldUser'

     

    K. Brian Kelley
    @kbriankelley

  • thank you...that does the trick.

    I appreciate your help more then you'll ever know.

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

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