I moved a database from SQL Server 2012 to Azure. I don't want to use the user master
, so I created a user test
. This is what I did for database XXX on Azure:
create user test from login test with default_schema=[dbo]
exec sp_addrolemember 'db_owner','test'
I checked, and the database objects I am interested in are all in the schema dbo
. The table Users
is in the schema dbo
.
The connection string in my web project has test
as the login. It produces the error message:
The SELECT permission was denied on the object 'Users', database 'XXX', schema 'dbo'
What does the error message mean and what can I do to let user test
access the database XXX?
This question is related to
sql-server
azure-sql-database
The syntax to grant select permission on a specific table :
USE YourDB;
GRANT SELECT ON dbo.functionName TO UserName;
To grant the select permission on all tables in the database:
USE YourDB;
GRANT SELECT TO UserName;
May be your Plesk panel or other panel subscription has been expired....please check subscription End.
Grant permissions for that user is needed
Check space of your database.this error comes when space increased compare to space given to database.
Properties
.Membership
.Make sure you uncheck
db_denydatareader
db_denydatawriter
This should go without saying, but only grant the permissions to what the user needs. An easy lazy fix is to check db_owner
like I have, but this is not the best security practice.
This is how I was able to solve the problem when I faced it
I resolve my problem doing this. [IMPORTANT NOTE: It allows escalated (expanded) privileges to the particular account, possibly more than are needed for individual scenario].
Using SSMS, I made sure the user had connect permissions on both the database and ReportServer.
On the specific database being queried, under properties, I mapped their credentials and enabled datareader and public permissions. Also, as others have stated-I made sure there were no denyread/denywrite boxes selected.
I did not want to enable db ownership when for their reports since they only needed to have select permissions.
Source: Stackoverflow.com