How to restore the database account username/User Name

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.