Link to home
Start Free TrialLog in
Avatar of Milkybar-kid
Milkybar-kid

asked on

Re-add a user to SQL2005 database

If a user is removed from a database in error can it be re-added just by using the same name?

i.e User fred has dbo_owner rights and owns table fred.table1

fred is deleted as a user then re-added as dbo_owner

Will "new" fred have the same permissions as "old" fred?
Avatar of tigin44
tigin44
Flag of Türkiye image

if you are adding the user with the db_owner privileges then the user by default has the privilages to access all the database objects, define DDL and DML operations... db_owner is a strong role from the point of privilages.
ASKER CERTIFIED SOLUTION
Avatar of laneduncan
laneduncan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ick.  I see that the quotes got munged above.  The sp_change_users_login should be:
exec sp_change_users_login 'update_one', 'sqlusername', 'sqlloginname'

where  sqlusername is the db user, and sqlloginname is the instance login.