Just question the poped up during discussion with my collegue regarding fixing SQL orphan users when they are available at instance level and database level after refresh task.
Use [database name]
exec sp_change_users_login 'Autofix', 'Usernname'
exec sp_change_users_login ‘update_one’, ‘username’,'userlogin’;
Links user entries in the sysusers table in the current database to logins of the same name in syslogins. It is recommended that the result from the Auto_Fix statement be checked to confirm that the links made are the intended outcome. Avoid using Auto_Fix in security-sensitive situations. Auto_Fix makes best estimates on links, possibly allowing a user more access permissions than intended. User must be a valid user in the current database, and login must be NULL, a zero-length string (”), or not specified.
Links the specified user in the current database to login. Login must already exist. user and login must be specified.
Testing did not find AUTOFIX option giving more privleages to SQL logins at database level , so unable to prove the AUTO_FIX causes more access permissions.
Does anyone has any suggestions on best way to go about this ??
Cheer Satish :-)