Check out example codes for "User, group, or role 'open' already exists in the current database.". It will help you in understanding the concepts better.

Code Example 1

sp_change_users_login 'AUTO_FIX', 'someuser'

Learn ReactJs, React Native from akashmittal.com