Restricting a sysadmin login

  • Hi,

    I created a login with full access, sysadmin, and now i want to restrict it to only 2 databases.

    I tried dropping, and recreating it, only mapping it to the specified databases.

    However no matter what i do, i get a 'User group, or role MyUser already exists. error.

    Even tried removing it from all server roles before dropping it.

    Is there a way i can remove completely a login from the database, so i can start from scratch with that login name

    Any advise welcome.

    Gerry

  • A sysadmin account has full permissions to the entire instance and nothing can be denied to it. If you want something that only has permissions to some DBs, it cannot be a sysadmin account.

    To drop a database user - DROP USER <user name>. To drop a login DROP LOGIN <login name>

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thanks Gail for the quick reply.

    Problem was i had a user with the same name, in the db users list.

    Once i remove it, then it allowed me to re-create the login.

    Cheers

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

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