[ACCEPTED]-The SELECT permission was denied on the object 'Address', database 'CNET_85731', schema 'dbo'-asp.net-3.5
As problem states, "The SELECT permission 4 was denied on the object 'Address', database 3 'CNET_85731', schema 'dbo' ".
I wonder you 2 can quite simply solve this way:
- Open SQL Server Management studio
- Navigate to the database 'CNET_85731' >> Security >> Users
- Right click on the one which you are using in your code
- And finally, just select 'db_datareader' inside "Database Role membership" section.
Now, I hope 1 you should not get this error again.
Well I'm not sure what the root cause was 8 for the SELECT permission denied for your 7 db user but if you run this and then it 6 does indeed work again, then somewhere along 5 the line, your SELECT permission was indeed 4 wiped out.
GRANT SELECT ON [dbo].[Address] TO [your user name here]
The good news is that permissions 3 don't magically disappear; the bad news 2 is something (either tooling or otherwise) did 1 indeed either remove or revoke permissions.
I don't think we have enough information to answer your question as to "why" it happened -- although, none of what you posted appears to be the culprit.
In your SQL Server Management Studio, right 3 click on your database, then click permission, then 2 select the user, then grant select,edit,update 1 and delete. Source http://go4answers.webhost4life.com/Example/select-permission-denied-object-159536.aspx
Had a quick google, found this link Link
It suggests 2 running
select object_name(major_id) as object,
user_name(grantee_principal_id) as grantee,
user_name(grantor_principal_id) as grantor,
permission_name,
state_desc
from sys.database_permissions
where major_id = object_id('Users')
and class = 1
On your database to see what permissions 1 exist, as you may have a DENY select
Edit
select object_name(major_id) as object,
user_name(grantee_principal_id) as grantee,
user_name(grantor_principal_id) as grantor,
permission_name,
state_desc
from sys.database_permissions
WHERE state_desc = 'DENY'
Managed to find a running SQL 2k8 box, and ran it, this new query will show all the deny's. Also try taking the WHERE clause out, to see all the permissions on all tables in the currently selected Database
If it gives you that error within SQL server 3 Management Studio then just run the SQL 2 server Management Studio as administrator 1 that should work.
Remove the following part of your connection 2 string;
Integrated Security=True;
And everything 1 works fine for me.
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.