SQL query of isolated users

Source: Internet
Author: User
After a database of SQL Server 2000 is backed up, after restoration, it is found that the original user cannot connect to the database. This is because the restored database user has not logged on to SQL. solution:

Use in query Analyzer

Sp_change_users_login 'report'

View the isolated username and Sid.

The username and USERSID are queried.

SS 0x40b8125724fef14994ebdf83b0cbdf24

Then use

Sp_addlogin 'ss', 'pubuser', 'pmdb6', 'simplified China', 0x40b8125724fef14994ebdf83b0cbdf24

To add a login to the SS, the password is pubuser, the database is pmdb6, the default language in the Enterprise Manager, right-click the database server --> properties --> database settings to view the default database language.

Then you can log on to the database with the user name SS and password pubuser.

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.