When you access the SQL Server database, the system prompts "invalid XXX object name"

Source: Internet
Author: User

symptom:

when you access the SQL Server database, the system prompts "invalid XXX Object Name"

root cause:

the user may be a database user, but the database does not grant the user the corresponding access permission

solution:

assign permissions to database users. For details, see.

1. Assume that the database name is "happy" and the user name is "Haha.

2. Choose "Happy Database"> "user"> "new database user"> "Log on name"> "new"> enter "Haha"> "Confirm Password"> the Haha account is successfully created.

* Note: Select SQL for identity authentication. The default database is happy, and the server role is db_owner. Remember to select happy for database access.

* supplement: if the server role in the intermediate step is not selected, use the new account and password to access the server, the following error occurs: "sqlserver rejects the select permission on the object 'hello' (Database 'Happy ', owner 'dbo')" and selects db_owner again in the account attributes, you can also tick the "Select Insert update Delete" and other items to access the table in the permission settings.
in this case, run the Program again and you will see the successfully accessed page.

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.