MS SQL Server Error 21002: [SQL-DMO] User "XXX" already exists

xiaoxiao2021-03-06  46

Error 21002: [SQL-DMO] User "XXX" already exists, how to solve! Urgent!! After logging in to the user, the tables in the database cannot be used when we can't use because the SID is different. It is necessary to correspond to our newly built, the database relies on the SID to identify the user. Here you can use the stored procedure sp_change_users_login. It has three actions, named, update_one, and auto_fix. Run sp_change_users_login 'Report', the system will list the number of isolated users of the current database. We only need to select the current database as testdb, then run sp_change_users_login 'update_one', 'test', 'test' will prompt to fix an isolated user. If you do not build TEST login users, you can also create a login user name TEST with sp_change_users_login 'auto_fix', 'test', null, 'TestPassword', and the password is called TestPassword. Ok, it is usually based on the situation here, the database object has been resolved. If there are multiple databases in multiple databases, you only need to select a different database, and the one of UPDATE_ONE is required.

转载请注明原文地址:https://www.9cbs.com/read-80284.html

New Post(0)