SELECT permission denied on object 'tablename' (database 'dbname', schema 'dbo')

Problem: "SELECT permission denied on object 'tab_xxx' (database 'db_xxx', schema 'dbo')."

Scenario: Problems encountered when testing ASP.NET websites in IIS (ASP.NET+SQL2008)

Solution:

1. Open the SQL2008 management interface;

2. Open the database to be used;

3. Turn on security;

4. Open the user;

5. Right-click the properties of the user used;

6. Select "General", in the "Database Role Membership (M):" list, select the "db_owner" check box, and click OK.

problem solved.

Reason analysis: In the newly created user, the database used is not given the corresponding permissions, so the above problems will not only have the above prompts for SELECT|UPDATE|INSERT|DELETE, but also in the security of the database. In the user properties, giving the user db_owner permissions can solve such a problem. According to the data, "owner means owner. It refers to the owner of a database. It has the permission to modify, delete, add data tables to the database, and execute most stored procedures. However, some systems are involved. The permissions for sensitive operations are not available, and this is the only difference between it and SA permissions."

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325257828&siteId=291194637