After the system is reinstalled or the database is reinstalled, the user name is found in the database after the database is attached, but there is no login name in sqlserver.
For example
First, the user name has the User Name of the previous system.
Now let's add this login name first
Click Cancel
Go to the query analyzer and select the database you want to repair.
Sp_change_users_login 'report': queries isolated users in the current database.
We only need to select the database to be repaired by the current database, and then run sp_change_users_login 'Update _ one', 'username', 'username'
The system prompts you to fix an isolated user.
The user who refresh the database again will see that the user name corresponds to the login name.
I also want to explain some tips. Sometimes the ldf file will be very large. Now, the query Analyzer of the database you want To Compress
Operation dump transaction databasename with no_log, and then contract the log file. The final result is 1024 K.
In addition, modify the database port of sqlserver2000