Bind a SQL Server database to a user and login name

Source: Internet
Author: User

Server reload system, reinstall on SQL Server, attach to previous database,

Then there was a login for each database that was used to manipulate the database, and the other databases were not operational.

Attached to the database after the user in the security of the database can see the previously established users, but in the system-level security outside the login name does not have a corresponding user, a login user and directly prompt the user already exists,

Search the internet for a bit, the solution is as follows:

System-level security, the login name there is a new user with the same name, authorized there is nothing to choose, will not prompt the user already exists, and then execute the following SQL statement, the database user and the login name associated with:

use qikai_guanwang   --数据库名,中间带点用[] go sp_change_users_login  ‘update_one‘ ‘qikai‘ ‘qikai‘  --‘qikai‘‘qikai‘用户名和登录名

Bind a SQL Server database to a user and login name

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.