View difference between Paste ID: n54ZM6TA and 8rhDUucV
SHOW: | | - or go back to the newest paste.
1-
USE AdventureWorks2012;
1+
--lists the orphaned users:
2-
GO
2+
EXEC sp_change_users_login 'Report'
3-
EXEC sp_change_users_login 'Auto_Fix', 'Mary', NULL, 'B3r12-3x$098f6';
3+
4-
GO
4+
--If you already have a login id and password for this user, fix it by doing:
5
EXEC sp_change_users_login 'Auto_Fix', 'user'
6
7
--If you want to create a new login id and password for this user, fix it by doing:
8
EXEC sp_change_users_login 'Auto_Fix', 'user', 'login', 'password'
9
10
An invalid parameter or option was specified for procedure ‘sys.sp_change_users_login’.
11
pas NULL as 'login' parameter