MS SQL Server Account Processing
orphaned accounts are typically produced in the following two ways:
1 .restore the backed up database on the other machine;
2 . re-install the system orSQL SERVERthen only the user library is restored
Workaround:
First, sp_change_users_login to fix.
Second, delete the account and re-create
sp_change_users_login There are three ways to use
usage 1 :
Execsp_change_users_login ' report '
List orphaned users of the current database
usage 2 :
exec sp_change_users_login ' auto_fix ', ' User name'
you can automatically add a login with the same name that corresponds to the user name tosysloginsin
usage 3 :
execsp_change_users_login ' Update_One ', ' User name', 'Login Name'
maps the user name to the specified login name.
Second, delete the account and re-create
See if the user SID is consistent, and if not, delete and re-create the account.
Selectname,sid from master.sys.server_principals where name = ' HELLO_RW '
Select Name,sid from sys.database_principals where name = ' HELLO_RW '
Delete Account Statement
EXEC sp_dropuser ' Hello _rw ';
GO
Create an account:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4C/F4/wKiom1RIWSTDOZRpAAHPWlpQeBg227.jpg "title=" 1.png " alt= "Wkiom1riwstdozrpaahpwlpqebg227.jpg"/>
Permission to write
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4C/F5/wKioL1RIWYSgaJPCAAEQRFguDtI861.jpg "title=" 2.png " alt= "Wkiol1riwysgajpcaaeqrfgudti861.jpg"/>
This article from "lyq314" blog, declined reprint!
MS SQL Server Account processing